henrydenhengst

Useful Terminal Commands and Tools for Ubuntu / Mint

Aug 26th, 2015
814
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.78 KB | None | 0 0
  1. # 1. Make An ISO From A Folder
  2. # If you want to make an iso file from a directory containing other files and sub-directories via the terminal, you can use the following command:
  3. mkisofs -o image.iso -R /path/to/folder/
  4. # If you wish to backup the home folder, use this command:
  5. mkisofs -o image.iso -R $HOME
  6. # 2. Remove Non-Empty Folder
  7. # To remove a non-empty folder from the command line, you can use this command:
  8. rm -rf /path/to/folder/
  9. # 3. Checking Current CPU Architecture (32-bit or 64-bit)
  10. # To list your processor architecture in Ubuntu/Linux Mint, use one of these commands:
  11. uname -m
  12. # or
  13. arch
  14. # or
  15. file /bin/bash | cut -d' ' -f3
  16. # 4. Generate Random Passwords
  17. # To generate random passwords via the terminal, you can use the following commands:
  18. # a - makepasswd
  19. # makepasswd is a command line tool for generating passwords in Ubuntu/Linux Mint. Install it with this command:
  20. sudo apt-get install makepasswd -y
  21. # To generate a password with 20 characters, enter this command:
  22. makepasswd --chars=20
  23. # b- OpenSSL
  24. # You can also use OpenSSL to generate random passwords using this simple command:
  25. openssl rand -base64 20
  26. # 5. Check Uptime
  27. # To check for how long your computer or laptop has been running since you powered it on, issue this command:
  28. uptime
  29. # To monitor system uptime in real-time, use this command:
  30. watch -n 1 uptime
  31. # 6. Check Information About Your Video Card
  32. # To list information about your graphics card (Nvidia, AMD, Intel, etc.), enter this command:
  33. lspci -v -s `lspci | awk '/VGA/{print $1}'`
  34. # 7. Download And Extract Tar Files In One Command
  35. # If you want to extract an archive file after being downloaded in a single command, you can use the following command for tar files:
  36. wget URL-To-TAR-File -O - | tar xfz -
  37. # Here is an example:
  38. wget http://garr.dl.sourceforge.net/project/multibootusb/MultiBootUSB_4.7.tar.gz -O - | tar xfz -
  39. # 8. Block/Unblock Wifi/Bluetooth
  40. # To disable wifi or Bluetooth in Ubuntu/Linux Mint, we can simply use the rfkill command line tool. To deactivate wifi, enter this command:
  41. rfkill block wlan
  42. # For Bluetooth:
  43. rfkill block bluetooth
  44. # To unblock WiFi, enter this command:
  45. rfkill unblock wlan
  46. # For Bluetooth:
  47. rfkill unblock bluetooth
  48. # 9. Check CPU Temperature
  49. # To get the current temperature of your processor, issue this command:
  50. acpi -t
  51. # To check CPU temp in real-time, run this command:
  52. watch -n 1 acpi -t
  53. # 10. Change Read Speed Of A CD/DVD
  54. # Let's first get the maximum read speed of your optical drive with this command:
  55. eject -X
  56. # To increase/decrease read speed of a CD/DVD inserted into your optical drive, enter this command followed by the desired speed:
  57. eject -x 4
  58. # For more than one optical disc drive, use this command:
  59. eject /dev/cdrom -x 4
  60. # 11. Check RAM Speed
  61. # To check memory speed from the command line, run this command:
  62. sudo dmidecode -t 17 | awk -F":" '/Speed/ { print $2 }'
  63. # 12. Read/Write Speed Of A Hard Disk
  64. # To check read/write speed of your hard drive on the terminal, use this command:
  65. sudo hdparm -tT /dev/sda
  66. # 13. Monitor Network Usage
  67. # IPTraf is a command line utility that allows to monitor network activities in real-time. Install it in Ubuntu/Linux Mint with this command:
  68. sudo apt-get install iptraf -y
  69. # Start monitoring using this command:
  70. sudo iptraf
  71. # 14- Downloading Websites
  72. # If you want to download an entire website via the terminal, enter this command:
  73. wget --recursive  --page-requisites --convert-links www.domain.com
  74. # 15. Check Gmail Unread Messages
  75. # To check for unread messages in your Gmail account, use this command:
  76. sudo apt-get install curl -y
  77. curl -u GMAILUSER --silent "https://mail.google.com/mail/feed/atom" | perl -ne 'print "\t" if //; print "$2\n" if /<(title|name)>(.*)<\/\1>/;'
  78. # 16. Monitor HDD Temperature
  79. # Use hddtemp to monitor hard disk temperature on the terminal. Run these commands:
  80. sudo apt-get install hddtemp -y
  81. sudo hddtemp /dev/sda
  82. # 17. Check Current Kernel Version
  83. # You can simply use this command:
  84. uname -r
  85. # 18. Dtrx
  86. # The dtrx tool allows to extract most archive files without the hassle of memorizing the various extraction commands. To install it, run this command:
  87. sudo apt-get install dtrx -y
  88. # Here are some examples:
  89. dtrx file.zip
  90. dtrx file.tar.gz
  91. dtrx file.7z
  92. # 19. Glances - An eye on your system
  93. # Glances is a free software (licensed under LGPL) to monitor your GNU/Linux or BSD operating system from a text interface.
  94. # Glances uses the library libstatgrab to retrieve information from your system and it is developed in Python.
  95. sudo apt-get install python-pip build-essential python-dev -y
  96. sudo pip install Glances
  97. sudo pip install PySensors
  98. # 20. Arpwatch – Ethernet Activity Monitor
  99. # Arpwatch is a kind of program that is designed to monitor Address Resolution (MAC and IP address changes) of Ethernet network traffic on a Linux network.
  100. # It continuously keeps watch on Ethernet traffic and produces a log of IP and MAC address pair changes along with a timestamps on a network.
  101. # It also has a feature to send an email alerts to administrator, when a pairing added or changes. It is very useful in detecting ARP spoofing on a network.
  102. sudo apt-get arpwatch -y
  103. # 21. clamav anti-virus
  104. sudo apt-get install clamav -y
  105. sudo freshclam
  106. # To check all files on the computer, displaying the name of each file:
  107. clamscan -r /
  108. # To check all files on the computer, but only display infected files and ring a bell when found:
  109. clamscan -r --bell -i /
  110. # To check files in the all users home directories:
  111. clamscan -r /home
  112. # To check files in the USER home directory and move infected files to another folder:
  113. clamscan -r --move=/home/USER/VIRUS /home/USER
  114. # To check files in the USER home directory and remove infected files (WARNING: Files are gone.):
  115. clamscan -r --remove /home/USER
  116. # To see more options:
  117. clamscan --help
Advertisement
Add Comment
Please, Sign In to add comment