Ubuntu Based Commands
This section will explore basic ubuntu commands for file and directory management.
sudo command
sudo (command)
Ex: sudo useradd username
Superuser do or sudo is one of the most basic commands in Linux. It runs your command with administrative or root permissions.
When you run a sudo command, Terminal will request the root password. For example, this snippet runs useradd with the superuser privilege.
su command
su [options] [username [argument]]
The su command lets you run a program in the Linux shell as a different user. It is useful to connect via SSH while the root user is disabled.
htop command
htop [commands]
The htop command is an interactive program for monitoring system resources and server processes. Unlike top, it offers additional features like mouse operation and visual indicators.
hostname command
hostname [option]
Run the hostname command to display the system’s hostname.
systemctl command
systemctl [commandname] [service_name]
The systemctl command lets you manage installed services in your Linux system.
To use the command, the user must have root privilege. It has several use cases, including starting, restarting, and terminating a service. You can also check a service’s status and dependencies.
apt-get command
apt-get [options] (command)
apt-get is a command line tool for handling Advanced Package Tool (APT) libraries in Debian-based Linux, like Ubuntu. It requires sudo or root privileges.
This Linux command lets you manage, update, remove, and install software, including its dependencies.
history command
history
Ex: !255
Enter history to list previously executed commands. It lets you reuse the commands without rewriting them. To use it, enter this syntax with sudo privileges.
ifconfig command
ifconfig
The ifconfig command lets you list and configure your system’s network interface. In newer Linux distros, it is equivalent to the ip command.
scp command
scp [option] [source username@IP]:/[directory and file name] [destination username@IP]:/[destination directory]
The scp command securely copies files or directories between systems over a network.
curl command
curl [option] URL
The curl command transfers data between servers. Its common usage is for retrieving a web page’s content to your system using its URL.
Last updated