Linux Commands
Full linux Commands https://www.golinuxcloud.com/linux-commands-cheat-sheet/
The commands under this section are very basic commands and must be known to every system administrator. This is definitely not the complete list of Linux commands for file management but can give you a kickstart and can cover most of the basic to complex scenarios.
1. System Based Commands
| Displays Linux system information |
| Displays kernel release information |
| Displays how long the system has been running including load average |
| Shows the system hostname |
| Displays the IP address of the system |
| Shows system reboot history |
| Displays current system date and time |
| Query and change the System clock |
| Displays the current calendar month and day |
| Displays currently logged in users in the system |
| Displays who you are logged in as |
| Displays information about the user |
2. Hardware Based Commands
| Displays bootup messages |
| Displays more information about CPU e.g model, model name, cores, vendor id |
| Displays more information about hardware memory e.g. Total and Free memory |
| Displays information about system's hardware configuration |
| Displays block devices related information |
| Displays free and used memory in the system (-m flag indicates memory in MB) |
| Displays PCI devices in a tree-like diagram |
| Displays USB devices in a tree-like diagram |
| Displays hardware information from the BIOS |
| Displays information about disk data |
| Conducts a read speed test on device xda |
| Tests for unreadable blocks on disk |
3. Users Management Commands
| Displays the details of the active user e.g. uid, gid, and groups |
| Shows the last logins in the system |
| Shows who is logged in to the system |
| Adds the group 'admin' |
| Adds user Sam |
| Deletes user Sam |
| Used for changing / modifying user information |
4. File Commands
| Lists files - both regular & hidden files and their permissions as well. |
| Displays the current directory file path |
| Creates a new directory |
| Removes a file |
| Forcefully removes a file |
| Removes a directory recursively |
| Removes a directory forcefully and recursively |
| Copies the contents of file1 to file2 |
| Recursively Copies dir1 to dir2. dir2 is created if it does not exist |
| Renames file1 to file2 |
| Creates a symbolic link to file_name |
| Creates a new file |
| Places standard input into a file |
| Outputs the contents of a file |
| Displays the first 10 lines of a file |
| Displays the last 10 lines of a file |
| Encrypts a file |
| Decrypts a file |
| Prints the number of bytes, words and lines in a file |
| Executes commands from standard input |
5. Process Related Commands
| Display currently active processes |
| Searches for the id of the process 'telnet' |
| Displays memory map of processes |
| Displays all running processes |
| Terminates process with a given pid |
| Kills / Terminates all processes named proc |
| Sends a signal to a process with its name |
| Resumes suspended jobs in the background |
| Brings suspended jobs to the foreground |
| job n to the foreground |
| Lists files that are open by processes |
| makes a process run with very low priority |
| find Firefox process ID |
| visualizing processes in tree model |
6. File Permission Commands
| Change file permissions of the file to octal |
| Set rwx permissions to owner, group and everyone (everyone else who has access to the server) |
| Set rwx to the owner and r_x to group and everyone |
| Sets rwx for owner, rw for group and everyone |
| Change ownership of the file |
| Change owner and group owner of the file |
| Change owner and group owner of the directory |
7. Network Commands
| Displays IP addresses and all the network interfaces |
| Assigns IP address 192.168.0.1 to interface eth0 |
| Displays IP addresses of all network interfaces |
| ping command sends an ICMP echo request to establish a connection to server / PC |
| Retrieves more information about a domain name |
| Retrieves DNS information about the domain |
| Performs reverse lookup on a domain |
| Performs an IP lookup for the domain name |
| Displays local IP address |
| Downloads a file from an online source |
| Displays all active listening ports |
8. Compression/Archives Commands
| Creates archive file called 'home.tar' from file 'home' |
| Extract archive file 'files.tar' |
| Creates gzipped tar archive file from the source folder |
| Compression a file with .gz extension |
9. Install Packages Commands
| Install an rpm package |
| Removes an rpm package |
| Install package using dnf utility |
10. Install Source (Compilation)
| Checks your system for the required software needed to build the program. It will build the Makefile containing the instructions required to effectively build the project |
| It reads the Makefile to compile the program with the required operations. The process may take some time, depending on your system and the size of the program |
| The command installs the binaries in the default/modified paths after the compilation |
11. Search Commands
| Search for a given pattern in files |
| Search recursively for a pattern in a given directory |
| Find all instances of the file |
| Find file names that begin with 'index' in /home folder |
| Find files greater than 10000k in the home folder |
12. Login Commands
| Securely connect to host as user |
| Securely connect to host using a specified port |
| Securely connect to the system via SSH default port 22 |
| Connect to host via telnet default port 23 |
13. File Transfer Commands
| Securely copy file1.txt to server2 in /tmp directory |
| Synchronize contents in /home/apps directory with /backup directory |
14. Disk Usage Commands
| Displays free space on mounted systems |
| Displays free inodes on filesystems |
| Shows disk partitions, sizes, and types |
| Displays disk usage in the current directory in a human-readable format |
| Displays target mount point for all filesystems |
| Mount a device |
15. Directory Traverse Commands
| Move up one level in the directory tree structure |
| Change directory to $HOME directory |
| Change directory to /test directory |
Last updated