Introduction
After part one we will look into more linux commands to enhance our use of commandline and troubleshoot any problems.
ln - Create hard or symbolic links to files.
ln -s /path/to/source/file link_name
uptime - Display system uptime and load averages.
uptime
who - Display information about logged-in users.
who
whatis - Display one-line manual page descriptions.
whatis command_name
chroot - Change the root directory for a command.
chroot /new/root /bin/bash
which - Display the path of an executable.
which command_name
uptime - Display system uptime and load averages.
uptime
nmcli - Command-line client for NetworkManager.
nmcli connection show
rsync - Sync files and directories between systems.
rsync -avz source/ destination/
cut - Remove sections from lines of files.
cut -d, -f2 file.csv
- sed - Stream editor for text manipulation.
sed 's/old_text/new_text/' file.txt
- awk - Text processing tool for data extraction.
awk '{print $1}' file.txt
- sort - Sort lines of text files.
sort file.txt
- uniq - Remove duplicate lines from sorted files.
sort file.txt | uniq
- diff - Compare files line by line.
diff file1.txt file2.txt
- tar - Archive and compress files.
tar -cvzf archive.tar.gz directory/
- crontab - Schedule repetitive tasks using cron.
crontab -l
crontab -e
- wget - Download files from the internet.
wget https://example.com/file.zip
- curl - Transfer data to/from servers.
curl -O https://example.com/image.jpg
- zip and unzip - Create and extract compressed zip archives.
zip archive.zip file1.txt file2.txt
- ps - Display information about running processes.
ps aux
- kill - Terminate processes.
kill process_id
- killall - Terminate processes by name.
killall process_name
- nice - Adjust process priority.
nice -n 10 command
- renice - Change the priority of a running process.
renice -n 5 -p process_id
- whereis - Locate the binary, source, and manual page files for a command.
whereis command_name
- alias - Create shortcut commands.
alias ll='ls -al'
- file - Determine file type.
file file.txt
- df - Display disk space usage.
df -h
- du - Display file and directory space usage.
du -sh /var
- quota - Manage disk quotas for users.
quota -u user
- ssh-keygen - Generate SSH key pairs.
ssh-keygen -t rsa
- ssh-copy-id - Copy SSH keys to a remote server.
ssh-copy-id user@remote_server
- scp - Securely copy files between systems.
scp file.txt user@remote_server:/path/to/destination/
- ping - Check network connectivity.
ping google.com
- traceroute - Trace the route packets take to a destination.
traceroute google.com
- netstat - Display network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
netstat -tuln
- ss - Display socket statistics.
ss -tuln
- route - Display and manipulate IP routing table.
route -n
- hostname - Display or set the system’s host name.
hostname
- history - View command history.
history
- shutdown and reboot - Shutdown or restart the system.
sudo shutdown -h now
sudo reboot
- file - Determine file type.
file file.txt
- lsblk - List block devices.
lsblk
- parted - Disk partitioning tool.
parted /dev/sdX
- nmcli - Command-line client for NetworkManager.
nmcli connection show
- useradd and userdel - Add and delete user accounts.
sudo useradd newuser
sudo userdel olduser
- groupadd and groupdel - Manage user groups.
sudo groupadd mygroup
sudo groupdel mygroup
- w - Show who is logged on and what they are doing.
w
- chsh - Change login shell.
chsh -s /bin/bash username
Conclusion
With these 50 additional Linux commands and examples, you can expand your knowledge and enhance your proficiency in managing and working with Linux systems. These commands cover a wide range of tasks, from text processing and file manipulation to network diagnostics and system administration. Continue to explore and experiment with these commands to become a more skilled Linux user.