/linux
Linux command reference
Expanded Linux terminal commands for everyday development and ops work.
File Operations
8 commands
pwdPrint the current working directory.
ls -laList files with hidden entries and details.
mkdir -p new-folder/subfolderCreate nested directories in one command.
touch file.txtCreate an empty file or update its timestamp.
cp -r source targetCopy a directory recursively.
mv old-name new-nameMove or rename a file or folder.
find . -name "*.log"Search for files matching a name pattern.
rm -rf folder-nameRemove a directory and all of its contents.
Note: Use with care because this permanently deletes files.
Permissions
4 commands
chmod +x script.shMake a script executable.
chmod 644 file.txtSet common read/write permissions for a file.
chown user:group file.txtChange the ownership of a file.
sudo !!Rerun the last command with elevated privileges.
Search & Text
6 commands
grep -R "needle" .Search recursively for matching text.
tail -f app.logFollow a log file in real time.
head -n 20 file.txtShow the first 20 lines of a file.
less file.txtOpen a file with interactive paging.
wc -l file.txtCount the number of lines in a file.
sort file.txt | uniqSort text and remove duplicate lines.
Processes & Networking
6 commands
ps aux | grep nodeFind running Node.js processes.
topMonitor system processes interactively.
kill -9 <pid>Force-stop a process by its PID.
df -hShow disk usage in a readable format.
du -sh *Display folder sizes in the current directory.
curl -I https://example.comFetch only HTTP response headers from a URL.