If you’re new to Unix commands, it’s natural to feel a bit overwhelmed. However, there’s no need to worry because we’re here to help. Whether you’re an experienced developer or just starting to learn Unix, having a cheat sheet of essential commands can make your life easier and your command-line experience smoother.
Let’s jump right in and explore these important Unix commands cheat sheet.
cd [directory]: Change directory.
ls: List files and directories.
pwd: Print the current working directory.
mkdir [directory]: Create a new directory.
rm [file]: Remove/delete a file.
rmdir [directory]: Remove/delete an empty directory.
2. File Manipulation Commands:
cp [source] [destination]: Copy files or directories.
mv [source] [destination]: Move or rename files or directories.
cat [file]: Display the contents of a file.
nano [file] or vim [file]: Open a text editor to edit a file.
touch [file]: Create an empty file or update the access and modification timestamps.
3. File Permission Commands:
chmod [permissions] [file]: Change file permissions.
chown [user:group] [file]: Change file owner.
chgrp [group] [file]: Change file group.
4. Process Management Commands:
ps: Display a snapshot of the current processes.
kill [PID]: Terminate a process using its process ID.
pkill [process name]: Send a signal to a process based on its name.
5. System Information Commands:
uname -a: Display system information.
df: Show disk space usage.
free: Display amount of free and used system memory.
6. Search and Filter Commands:
grep [pattern] [file]: Search for a specific pattern in a file.
find [directory] -name [filename]: Search for files and directories.
7. Compress and Decompress Commands:
tar -cvf [archive name] [directory]: Create a tarball from a directory.
tar -xvf [archive name]: Extract files from a tarball.
gzip [file] or gunzip [file]: Compress or decompress a file.
8. Networking Commands:
ping [host]: Check connectivity to a host.
ifconfig or ip a: Display network interfaces and their configurations.
netstat or ss: Display network statistics.
9. User Account Commands:
whoami: Display the current logged-in user.
passwd: Change user password.
useradd [username]: Add a new user.
10. Miscellaneous Commands:
echo [text]: Display a message on the screen.
date: Display the current date and time.
history: Display command history.
Make navigating these Unix command in line a breeze with these helpful commands. Print out this handy cheat sheet and stick it to your desk to improve your Unix skills. Happy coding!
Also See: NMAP Commands Cheatsheet