The most used Linux commands
Tags: devops, linux, shell, ubuntu
Published: 2024-07-09 09:10:09

Here are the must used Linux/Ubuntu commands :



### File System Management
`pwd:` Print the name of the current working directory.
`date:` print or set the system date and time.
`ls:` List information about the FILEs (the current directory by default).
`cd:` Change the shell working directory.
`touch:` Update the access and modification times of each FILE to the current time.
`cat:` Concatenate FILE(s) to standard output.
`cp:` Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
`mv:` Move SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
`rm:` Remove (unlink) the FILE(s).
`mkdir:` Create the DIRECTORY(ies), if they do not already exist.
`rmdir:` Remove the DIRECTORY(ies), if they are empty.
`echo:` Print each text after echo.
`vi `:Usefull and simple editor
`chmod:` Change the mode of each FILE to MODE.
`chown:` Change the owner and/or group of each FILE to OWNER and/or GROUP.
`find:` Utility for comprehensive file and directory.
`grep:` Search for matching patterns in a file.
`dd:` Copy a file, converting and formatting according to the operands.
`tail:` Output the last part of files
`head:` Output the first part of files
`more:` Filter for paging through text one screenful at a time.
`less:` Like more with many other feture.

### Process Management
`ps:` Report a snapshot of the current processes.
`kill:` Send a signal to a job.
`top:` Display Linux processes
`htop:` Display Linux processes with many fetures.
`free:` Display amount of free and used memory in the system

### Device Management
`df:` Show information about the file system on which each FILE resides,
`du:` Summarize disk usage of the set of FILEs, recursively for directories.
`lsmod:` Show the status of modules in the Linux Kernel.
`lsblk:` List block devices like hard disk and partions.
`fdisk:` manipulate disk partition table
`mount:` Mount a filesystem.
`umount:` Unmount filesystems.


### Package Management
`apt:` Provides a high-level commandline interface for the package management system.
`apt-get update:` Update package lists.
`apt-get install:` Install new packages.
`apt-get remove:` Remove packages.

### Archive Management
`tar:` Saves many files together into a single tape or disk archive.
`xz:` Compress or decompress .xz and .lzma files
`zip:` Saves many files together into a single tape or disk archive in zip format.
`unzip:` Un zip archive file .

### Networking
`ping:` Send ICMP ECHO_REQUEST to network hosts
`netstat:` Symbolically displays the contents of various network-related data structures.
`ifconfig:` Used to configure / show the kernel-resident network interfaces.
`ip:` Show and manipulate routing, network devices, interfaces and tunnels.
`iptables:` Administration tool for IPv4/IPv6 packet filtering and NAT.
`wget:` A non-interactive network retriever.
`curl:` curl is a tool for transferring data from or to a server.
`ssh:` Program for logging into a remote machine and for executing commands on a remote machine.
`scp:` Copies files between hosts on a network.
`ssh-keygen:` OpenSSH authentication key utility.
`ssh-copy-id:` Script that uses ssh to log into a remote machine.
`rsync:` Fast and extraordinarily versatile file copying tool.

### System Information
`man:` An interface to the on-line reference manuals
`uname:` Print certain system information. With no OPTION, same as -s.
`whoami:` Print the user name associated with the current effective user ID.
`sudo:` execute a command as another user
`hostnamectl:` Query and change the system hostname and related settings.
`history:` Show history of command input by user

### System Management
`systemctl:` Control the systemd system and service manager
`journalctl:` Query the systemd journal
`crontab:` Maintain crontab files for individual users
`usermod:` Modify a user account.
`adduser:` Add user to the system.
`addgroup:` Add group to the system.
`passwd:` Change user password.
`reboot:` halt, poweroff, reboot may be used to halt, power-off, or reboot the machine.

### Other Management
`awk:` Pattern scanning and processing language
`ln:` Make links between files
`tee:` Read from standard input and write to standard output and files
`cut:` Remove sections from each line of files
`tr:` Translate, squeeze, and/or delete characters from standard input, writing to standard output.
`sort:` Write sorted concatenation of all FILE(s) to standard output.
`uniq:` Filter adjacent matching lines from INPUT (or standard input), writing to OUTPUT
`git:` Tool for manage versioning.


These commands are for interacting with a Linux system and by using them you can do many daily tasks.
Note that some of these commands require package installation (such as the zip command).

Good luck