![]() Show disk usage of the directory you are currently in: du -shĭisplay target mount point for all filesystem: findmnt See disk usage for all files and directory: du -ah Show free inodes on mounted filesystems: df -iĭisplay disk partitions, sizes, and types with the command: fdisk -l See free and used space on mounted systems: df -h ![]() You can use the df and du commands to check disk space in Linux. Shut Down the system immediately: shutdown nowĪdd a new kernel module: modprobe Disk Usage View or limit system resource amounts: ulimit Show information about a particular user: finger Show current calendar (month and day): cal Query and change the system clock with: timedatectl Show the IP address of the system: hostname -i Show system information via uname command: uname -rĭisplay how long the system has been running, including load average: uptime Note: If you want to learn more about shell jobs, how to terminate jobs or keep them running after you log off, check out our article on how to use disown command. Run a Linux process in the background: nohup & Pause terminal or a Bash script until a running process is completed: wait List files opened by running processes with lsof command: lsofĬatch a system error signal in a shell script: trap "" List and resume stopped jobs in the background: bgīring the most recently suspended job to the foreground: fgīring a particular job to the foreground: fg Terminate all processes labelled “proc”: killall Terminate a process under a specific name: pkill Terminate a Linux process under a given ID: kill Show processes in a tree-like diagram: pstreeĭisplay a memory usage map of processes: pmap Install software from source code: tar zxvf Install a package using the APT package manager: apt install Install a package using the DNF package manager: dnf install ![]() Install a package using the YUM package manager: yum install Show package information and summary: yum info List all installed packages with yum: yum list installedįind a package by a related keyword: yum search Note: If you want to learn more about users and groups, take a look at our article on how to add a user to a group in Linux. Print all lines matching a pattern in a file: awk ' ' List number of lines/words/characters in each file in a directory with the xargs command: ls | xargs wcĬut a section of a file and print the result to standard output: cut -d Ĭut a section of piped data and print the result to standard output: | cut -d Show the number of words, lines, and bytes in a file using wc: wc Show the last 10 lines of a file with tail command: tail Show the contents of a file: more Īppend file contents to another file: cat > ĭisplay the first 10 lines of a file with head command: head Rename to with the command: mv Ĭreate a symbolic link to a file: ln -s /path/to/ Ĭreate a new file using touch: touch Recursively copy the contents of one file to a second file: cp -r Recursively remove a directory without requiring confirmation: rm -rf Ĭopy the contents of one file to another file: cp Show directory you are currently working in: pwdĬreate a new directory: mkdir List all files ( shows hidden files): ls -a Learn about them in our list of dangerous Linux commands. Note: Some commands are not recommended to use. See files larger than a specified size in a folder: find -size ![]() List names that begin with a specified character in a specified location by using the find command: find -name Recursively search for a pattern in a directory: grep -r įind all files and directories related to a particular name: locate Search for a specific pattern in a file with grep: grep Run a disk check on an unmounted disk or partition: fsck Searching Test for unreadable blocks on device/disk: badblocks -s /dev/ Show hardware information from the BIOS: dmidecodeĭisplay disk data information: hdparm -i /dev/diskĬonduct a read-speed test on device/disk: hdparm -tT /dev/ Show PCI devices in a tree-like diagram: lspci -tvĭisplay USB devices in a tree-like diagram: lsusb -tv See information about block devices: lsblk List hardware configuration information: lshw Hardware Informationĭisplay free and used memory with: free -h The commands found in the downloadable cheat sheet are listed below.
0 Comments
Leave a Reply. |