Skip to content

Instantly share code, notes, and snippets.

@psahni
Created November 12, 2024 11:20
Show Gist options
  • Save psahni/e8169cc318ae42a64584467c5a203476 to your computer and use it in GitHub Desktop.
Save psahni/e8169cc318ae42a64584467c5a203476 to your computer and use it in GitHub Desktop.
common_linux_commands
Linux commands - commonly used
๐—•๐—ฎ๐˜€๐—ถ๐—ฐ๐˜€:
`man` - Skim through manual for better understanding.
`nano` / `vim` - Use nano for basic editing, vim for advanced editing.
`ls -l` - List files with detailed info.
`ssh` - Connect to remote machines securely.
`df` / `du -hs *` - Check disk space usage.
`chown` / `chmod` - Change ownership and permissions of files.
`dig` - DNS lookup to find IPs of hostnames.
๐—˜๐˜ƒ๐—ฒ๐—ฟ๐˜†๐—ฑ๐—ฎ๐˜† ๐—จ๐˜€๐—ฒ:
`history` - View command history.
`cd -` - Switch to the previous directory.
`xargs` - Build and execute commands from input, with parallel execution support.
`pstree -p` - Display the process tree with process IDs.
`pgrep` / `pkill` - Find and signal processes by name.
๐—ฃ๐—ฟ๐—ผ๐—ฐ๐—ฒ๐˜€๐˜€๐—ถ๐—ป๐—ด ๐—™๐—ถ๐—น๐—ฒ๐˜€ ๐—ฎ๐—ป๐—ฑ ๐——๐—ฎ๐˜๐—ฎ:
`find . -iname '*file*'` - Locate files by name.
`grep` / `ack` / `ag` - Search within files, with ag being the fastest.
`awk` / `sed` - Manipulate and format text.
`sort` / `uniq` - Sort and find unique lines.
`cut` / `paste` - Extract or combine columns of text.
๐—ฆ๐˜†๐˜€๐˜๐—ฒ๐—บ ๐——๐—ฒ๐—ฏ๐˜‚๐—ด๐—ด๐—ถ๐—ป๐—ด:
`top` / `htop` - View system performance and resource usage.
`netstat -lntp` - List all listening ports and associated processes.
`dstat` - Combined system stats view.
`strace` - Trace system calls and signals.
`lsof` - List open files and associated processes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment