Linux Command Essentials
Survival guide for the command line.
Navigation
pwd # current directory
ls -la # list with details + hidden files
cd /path/to/dir
cd ~ # home
cd - # previous directoryFile operations
cp file1 file2 # copy
cp -r dir1 dir2 # copy directory
mv file1 file2 # move / rename
rm file # delete file
rm -rf dir # delete directory (careful!)
mkdir -p a/b/c # create nested directoriesText & search
cat file.txt # print file
less file.txt # paged view
grep "pattern" file # search in file
grep -r "pattern" . # recursive search
find . -name "*.py" # find files by nameProcess management
ps aux # list processes
top / htop # interactive monitor
kill <pid> # terminate process
kill -9 <pid> # force killPermissions
chmod 755 file # rwxr-xr-x
chmod +x script.sh # make executable
chown user:group file # change ownerNetworking
curl https://url # HTTP request
wget https://url # download file
ss -tlnp # open ports
