12/29/2022 0 Comments Linux command cheat sheetInstall 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 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 To unexpected things might happen if you don't have the quotes.The commands found in the downloadable cheat sheet are listed below. That's because, without the quotes, the shell will expand the wildcard before handing the parameters to find. In the find /dir -name name* should be in double quotes if you want it to recursively find all files starting with name: Find will do a recursive search by default.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |