Jul 31, 2024
ls
: Basic listingls -l
: Long listing
ls -a
: Show hidden filesls -t
: Sort by modification timels -h
: Human-readable sizesls -lath
cd [directory]
: Navigate to a directorycd -
: Return to the previous directorycd ..
: Go up one levelcd ~
: Go to home directorypwd
: Shows the current directoryclear
: Clears the terminal screentouch [filename]
: Create an empty filemkdir [directory_name]
: Create a single directorymkdir -p [directory_tree]
: Create nested directoriesmkdir -m 777 [directory_name]
: Create directory with specific permissionscp [source] [destination]
: Copy filescp -r [directory] [destination]
: Copy directories recursivelyrm [filename]
: Remove a filerm -r [directory]
: Remove a directory recursivelyrm [pattern*]
: Remove files with a specific patternmv [source] [destination]
: Move or rename files/directoriesdu
: Shows disk usage of directoriesdu -h
: Human-readable formatdu -s
: Summary of usagechmod [u|g|o]+/-[r|w|x] [file]
: Modify permissionschmod 777 [file]
: Numeric method for setting permissionschown [user]:[group] [file]
: Change file owner and groupcat [file]
: Display file contentscat [file1] [file2] > [newfile]
: Combine filesecho [text] > [file]
: Write text to a filetail [file]
: Display last 10 linestail -n [number] [file]
: Display last n linestail -f [file]
: Follow file changeshead [file]
: Display first 10 lineshead -n [number] [file]
: Display first n linesless [file]
: View file one page at a timemore [file]
: Similar to less, but less feature-richvi [file]
: Open file in vi editori
(Insert):
(colon), followed by commands like w
(write), q
(quit)nano [file]
: Open file in nano editorps
: Shows processes for current userps aux
: Detailed process listingtop
: Real-time process monitoringtop -u [username]
: Filter by userkill [PID]
: Terminate process by PIDkill -9 [PID]
: Forcefully terminate processjobs
: List background jobsbg
: Resume a job in backgroundfg
: Bring job to foregroundifconfig
: Deprecated but shows network configurationip addr
: Show IP addressesip route
: Show routing tableip addr add [IP] dev [interface]
: Add IP address to interfacenetstat -l
: Show listening portsss -t
: Show TCP socketsss -u
: Show UDP socketsss -p
: Show processes using socketsssh [user]@[host]
: Connect to remote machinescp [local_file] [user]@[host]:[remote_file]
: Copy file to remote machinersync [options] [source] [destination]
: Sync files and directoriesuname -a
: Detailed system informationdf -h
: Shows disk space usage in human-readable formatfind [path] -name [pattern]
: Find files by namefind [path] -size +1M
: Find files larger than 1MBfind [path] -mtime -30
: Find files modified in the last 30 daysgrep [pattern] [file]
: Search for pattern in filegrep -r [pattern] [directory]
: Recursively search in directorytar czf [archive.tar.gz] [files]
: Create compressed archivetar xzf [archive.tar.gz]
: Extract compressed archivegzip [file]
: Compress filegunzip [file.gz]
: Decompress fileuseradd [username]
: Add new useruseradd -m [username]
: Add user with home directoryuseradd -g [group] [username]
: Add user to specific groupuseradd -e [date] [username]
: Add user with expiration dateuserdel [username]
: Delete useruserdel -r [username]
: Delete user and home directorygroupadd [groupname]
: Add new groupgroupdel [groupname]
: Delete group