Essential Unix/Linux commands for file management and system operations
Print working directory
pwdList directory contents
ls -laChange directory
cd /path/to/directoryCreate directory
mkdir new-folderRemove empty directory
rmdir empty-folderCopy files/directories
cp source.txt destination.txtMove/rename files
mv old-name.txt new-name.txtRemove files
rm -rf directory/Create empty file
touch new-file.txtDisplay file contents
cat filename.txtView file page by page
less large-file.txtShow first lines
head -10 filename.txtShow last lines
tail -f logfile.logSearch text patterns
grep "search-term" file.txtFind files by criteria
find . -name "*.txt"Show system processes
topList processes
ps auxShow disk usage
df -hShow directory size
du -sh directory/Show memory usage
free -hTest network connectivity
ping google.comTransfer data from URLs
curl https://api.example.comDownload files
wget https://example.com/file.zipSecure shell connection
ssh user@hostnameSecure copy files
scp file.txt user@host:/path/Change file permissions
chmod 755 script.shChange file owner
chown user:group file.txtSet default permissions
umask 022Find files by name and content
# Find files by name
find . -name "*.txt"
# Find files by content
grep -r "search-term" .
# Find and replace in files
find . -name "*.txt" -exec sed -i 's/old/new/g' {} \;Manage running processes
# Find process by name
ps aux | grep process-name
# Kill process by PID
kill -9 12345
# Kill process by name
pkill process-name
# Background/foreground
command &
fg
bgCompress and extract files
# Create tar archive
tar -czf archive.tar.gz directory/
# Extract tar archive
tar -xzf archive.tar.gz
# Create zip archive
zip -r archive.zip directory/
# Extract zip archive
unzip archive.zipUse man for command documentation
Be careful with rm -rf - it deletes permanently
Use Ctrl+C to interrupt running commands
Use Tab for command completion
Use history to see previous commands