Help
- man pico
View the manual page (help) of the pico command. Press 'q' to quit.
File system
- pwd
Print the current working directory
- cd
Change directory to the user's home directory
- cd /etc
Change directory to /etc
- ls
List current directory content
- ls -l
List current directory content in long format
- ls -l /etc
List the content inside /etc directory in long format
- mkdir x
Create directory named "x"
- rmdir x
Remove directory named "x"
- rm x
Remove file named "x"
- rm -rf x
Remove directory x including all content inside forcefully (no prompts asked for confirmation)
- cp filex filey
Copy filex to filey
- cp -a /etc/nginx /etc/nginx.backup
Copy complete directory /etc/nginx to /etc/nginx.backup
- mv x y
Rename file or directory named 'x' to 'y'
- chmod +x /usr/local/bin/myscript
Change mode of the file to be an executable.
- chmod 755 /usr/local/bin/myscript
Change mode of the file so that
- read, write, exec permissions are set for the owner
- read and exec permissions are set for the users in the owning group
- read and exec permissions are set for all other users
- chown userx:groupy filez
Change the ownership of filez to user userx and user group groupy
System details
- df -h
Show file system usage (disk free)
- du -h
Show the current directory usage (disk usage)
- free -m
Show memory details
- cat /proc/cpuinfo (or less /proc/cpuinfo)
Show the cpu details
- uptime
Show system uptime and load average
Date/time
- date
Show date and time
- timedatectl
Show date, time and time synchronization details
User management
- adduser kamal
Add a new user to the system named "kamal"
- useradd -m kamal
Add a new user to the system named "kamal". Not interactive.
- passwd
Change the current user's password
- passwd kamal
Change the password of user named 'kamal'
Package management
- dpkg -l
List all installed packages
- dpkg -l | grep vim
Print only the lines containing word "vim" from the output of command "dpkg -l"
- apt update
Update package information from sources
- apt upgrade
Upgrade packages that can be upgraded
- apt-cache search color picker
Search for packages that matches the given text (color picker)
- apt-cache show gpick
Show the details of the package gpick
- apt install gpick
Install the package called gpick
Process management
- ps x
List all processes of the current user
- ps xa
List all system processes
- ps xa | grep nginx
Check if any process is running related to nginx
- top
Display system processes with additional details interactively. Press 'q' to quit.
- kill PID
Gracefully terminate a process with process id PID. PID of a process can be obtained from the ps command or top command.
- kill -9 PID
Forcefully terminate a process with the process id PID.
Service management
- systemctl status nginx
View the status of service nginx
- systemctl start nginx
If not running already, start nginx service
- systemctl stop nginx
Stop nginx service
- systemctl is-enabled nginx
Is nginx service configured to start at boot time?
- systemctl enable nginx
Enable nginx to start at boot time
- systemctl disable nginx
Stop nginx from starting at boot time