国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Table of Contents
1. Uptime Command
Check Uptime Version
2. W Command
Available Options
3. Users Command
4. Who Command
Who command Options
5. Whoami Command
6. ls Command
7. Crontab Command
8. Less Command
9. More Command
10. CP Command
11. MV Command
12. Cat Command
13. cd command (change directory)
14. pwd command (print working directory)
15. Sort command
16. VI Command
17. SSH Command (Secure Shell)
18. Ftp or sftp Command
19. Systemctl Command
20. Free command
21. Top Command
22. Tar Command
23. Grep Command
24. Find Command
25. lsof Command
26. last command
27. ps command
28. kill command
29. rm command
30. mkdir command example.
Home System Tutorial LINUX 30 Useful Linux Commands for System Administrators

30 Useful Linux Commands for System Administrators

Jul 05, 2025 am 09:20 AM

30 Useful Linux Commands for System Administrators

In this article we are going to review some of the useful and frequently used Linux or Unix commands for Linux System Administrators that are used in their daily life.

This is not complete but it’s a compact list of commands to refer to when needed. Let us start one by one how we can use those commands with examples.

1. Uptime Command

In Linux uptime command shows how long your system is running and the number of users who are currently logged in and also displays the load average of a system for 1, 5, and 15 minutes intervals.

<strong># uptime</strong>

08:16:26 up 22 min,  1 user,  load average: 0.00, 0.03, 0.22

Check Uptime Version

Uptime command don’t have other options other than uptime and version. It gives information only in hours:mins:sec if it is less than 1 day.

# uptime -V
procps version 3.2.8

2. W Command

The w command will display users currently logged in and their process along with showing load averages, login name, tty name, remote host, login time, idle time, JCPU, PCPU, command, and processes.

<strong># w</strong>

08:27:44 up 34 min,  1 user,  load average: 0.00, 0.00, 0.08
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
tecmint  pts/0    192.168.50.1     07:59    0.00s  0.29s  0.09s w

Available Options

  • -h : displays no header entries.
  • -s : without JCPU and PCPU.
  • -f : Removes from the field.
  • -V : (upper letter) – Shows versions.

3. Users Command

Users command displays currently logged-in users. This command doesn’t have other parameters other than help and version.

<strong># users</strong>

tecmint

4. Who Command

who command simply returns the user name, date, time, and host information. who command is similar to w command. Unlike the w command who doesn’t print what users are doing. Let’s illustrate and see the difference between who and w commands.

<strong># who</strong>

tecmint  pts/0        2012-09-18 07:59 (192.168.50.1)
<strong># w</strong>

08:43:58 up 50 min,  1 user,  load average: 0.64, 0.18, 0.06
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
tecmint  pts/0    192.168.50.1     07:59    0.00s  0.43s  0.10s w

Who command Options

  • -b: Displays last system reboot date and time.
  • -r: Shows current runlet.
  • -a, –all: Displays all information cumulatively.

5. Whoami Command

In Linux, a whoami command is used to print the currently logged-in username into your Linux system. If you are logged in as a root using sudo command “whoami” command return root as the current user.

<strong># whoami</strong>

tecmint

6. ls Command

ls command displays a list of files in a human-readable format.

<strong># ls -l</strong>

total 114
dr-xr-xr-x.   2 root root  4096 Sep 18 08:46 bin
dr-xr-xr-x.   5 root root  1024 Sep  8 15:49 boot

Sort file as per last modified time.

<strong># ls -ltr</strong>

total 40
-rw-r--r--. 1 root root  6546 Sep 17 18:42 install.log.syslog
-rw-r--r--. 1 root root 22435 Sep 17 18:45 install.log
-rw-------. 1 root root  1003 Sep 17 18:45 anaconda-ks.cfg

For more examples of the ls command, please check out our articles:

  • 10 lsof Command Examples in Linux
  • 7 Quirky ‘ls’ Command Tricks Every Linux User Should Know
  • How to Sort Output of ‘ls’ Command By Last Modified Date and Time

7. Crontab Command

List schedule jobs for current user with crontab command and -l option.

<strong># crontab -l</strong>

00 10 * * * /bin/ls >/ls.txt

Edit your crontab with -e the option. In the below example will open schedule jobs in VI editor. Make necessary changes and quit pressing :wq keys that save the setting automatically.

<strong># crontab -e</strong>

For more examples of Linux Cron Command, please read our earlier articles:

  • 11 Cron Scheduling Task Examples in Linux
  • How to Create and Manage Cron Jobs on Linux

8. Less Command

less command allows quickly viewing the file. You can page up and down. Press ‘q‘ to quit from less window.

<strong># less install.log</strong>

Installing setup-2.8.14-10.el6.noarch
warning: setup-2.8.14-10.el6.noarch: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Installing filesystem-2.4.30-2.1.el6.i686
Installing ca-certificates-2010.63-3.el6.noarch
Installing xml-common-0.6.3-32.el6.noarch
Installing tzdata-2010l-1.el6.noarch
Installing iso-codes-3.16-2.el6.noarch

9. More Command

more command allows quickly view file and shows details in percentage. You can page up and down. Press ‘q‘ to quit out from more window.

<strong># more install.log</strong>

Installing setup-2.8.14-10.el6.noarch
warning: setup-2.8.14-10.el6.noarch: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Installing filesystem-2.4.30-2.1.el6.i686
Installing ca-certificates-2010.63-3.el6.noarch
Installing xml-common-0.6.3-32.el6.noarch
Installing tzdata-2010l-1.el6.noarch
Installing iso-codes-3.16-2.el6.noarch
<strong>--More--(10%)</strong>

[ You might also like: Learn Why ‘less’ is Faster Than ‘more’ Command for Effective File Navigation ]

10. CP Command

A cp command copies file from source to destination preserving the same mode.

<strong># cp -p fileA fileB</strong>

You will be prompted before overwriting to file.

<strong># cp -i fileA fileB</strong>

[ You might also like: How to Force cp Command to Overwrite without Confirmation ]

11. MV Command

An mv command renames fileA to fileB using the -i option, which prompts confirmation before overwriting. Ask for confirmation if exist already.

<strong># mv -i fileA fileB</strong>

12. Cat Command

The cat command is used to view multiple files at the same time.

<strong># cat fileA fileB</strong>

You combine more and less command with cat command to view file contain if that doesn’t fit in single screen/page.

<strong># cat install.log | less</strong>

<strong># cat install.log | more</strong>

For more examples of Linux, cat commands read our article on 13 Basic Cat Command Examples in Linux.

13. cd command (change directory)

with the cd command (change directory or switch directory) it will go to fileA directory.

<strong># cd /fileA</strong>

14. pwd command (print working directory)

A pwd command return with the present working directory.

<strong># pwd</strong>

/root

15. Sort command

The sort command is used to sort lines of text files in ascending order. with -r options will sort in descending order.

<strong># sort fileA.txt</strong>

<strong># sort -r fileA.txt</strong>

16. VI Command

Vi is the most popular text editor available in most UNIX-like OS. Below examples open file in read-only with -R option. Press ‘:q‘ to quit from vi windows.

<strong># vi -R /etc/shadows</strong>

To learn more about vi editor, read our articles:

  • Learn Useful ‘Vi/Vim’ Editor Tips and Tricks
  • 8 Interesting ‘Vi/Vim’ Editor Tips and Tricks for Every Linux Administrator
  • How to Install Latest Vim Editor in Linux Systems

17. SSH Command (Secure Shell)

SSH command is used to login into the remote host. For example, the below ssh command will connect to the remote host (192.168.50.2) using the user as Narad.

<strong># ssh [email?protected]</strong>

To check the version of ssh use the option -V (uppercase) shows version of ssh.

<strong># ssh -V</strong>

OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f  31 Mar 2020

To learn more about SSH, read our articles:

  • How to Secure and Harden OpenSSH Server
  • How to Set a Custom SSH Warning Banner and MOTD in Linux
  • How to Setup SSH Passwordless Login in Linux [3 Easy Steps]

18. Ftp or sftp Command

ftp or sftp command is used to connect to remote ftp host. ftp is (file transfer protocol) and sftp is (secure file transfer protocol). For example, the below commands will connect to ftp host (192.168.50.2).

<strong># ftp 192.168.50.2</strong>

<strong># sftp 192.168.50.2</strong>

Putting multiple files in remote host with mput similarly, we can do mget to download multiple files from the remote host.

<strong># ftp > mput *.txt</strong>

<strong># ftp > mget *.txt</strong>

19. Systemctl Command

Systemctl command is a systemd management tool that is used to manage services, check running statuses, start and enable services and work with the configuration files.

# systemctl start httpd.service
# systemctl enable httpd.service
# systemctl status httpd.service

20. Free command

The free?command shows free, total, and swap memory information in bytes.

<strong># free</strong>
             total       used       free     shared    buffers     cached
Mem:       1030800     735944     294856          0      51648     547696
-/  buffers/cache:     136600     894200
Swap:      2064376          0    2064376

Free with -t options show total memory used and available to use in bytes.

<strong># free -t</strong>
             total       used       free     shared    buffers     cached
Mem:       1030800     736096     294704          0      51720     547704
-/  buffers/cache:     136672     894128
Swap:      2064376          0    2064376
Total:     3095176     736096    2359080

21. Top Command

top command displays processor activity of your system and also displays tasks managed by kernel in real-time. It’ll show processor and memory are being used.

Using the top command with u the option will display specific User process details as shown below. Press ‘O‘ (uppercase letter) to sort as desired by you. Press ‘q‘ to quit from the top screen.

<strong># top -u tecmint</strong>

top - 11:13:11 up  3:19,  2 users,  load average: 0.00, 0.00, 0.00
Tasks: 116 total,   1 running, 115 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.3%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1030800k total,   736188k used,   294612k free,    51760k buffers
Swap:  2064376k total,        0k used,  2064376k free,   547704k cached

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME   COMMAND
1889 tecmint   20   0 11468 1648  920 S  0.0  0.2   0:00.59 sshd
1890 tecmint   20   0  5124 1668 1416 S  0.0  0.2   0:00.44 bash
6698 tecmint   20   0 11600 1668  924 S  0.0  0.2   0:01.19 sshd
6699 tecmint   20   0  5124 1596 1352 S  0.0  0.2   0:00.11 bash

For more about top command, we’ve already compiled a list of 12 TOP Command Examples in Linux.

22. Tar Command

The tar command is used to compress files and folders in Linux. For example, the below command will create an archive for /home directory with the file name archive-name.tar.

<strong># tar -cvf archive-name.tar /home</strong>

To extract the tar archive file use the option as follows.

<strong># tar -xvf archive-name.tar</strong>

To understand more about tar command we’ve created a complete how-to guide on tar command at 18 Tar Command Examples in Linux.

23. Grep Command

grep command search for a given string in a file. Only tecmint user displays from /etc/passwd file. we can use -i an option for ignoring case sensitivity.

<strong># grep tecmint /etc/passwd</strong>

tecmint:x:500:500::/home/tecmint:/bin/bash

24. Find Command

Find command used to search files, strings, and directories. The below example of find command search tecmint word in ‘/‘ partition and return the output.

<strong># find / -name tecmint</strong>

/var/spool/mail/tecmint
/home/tecmint
/root/home/tecmint

For a complete guide on Linux find command examples fount at 35 Practical Examples of Linux Find Command.

25. lsof Command

lsof mean List of all open files. Below lsof a command list of all opened files by user tecmint.

<strong># lsof -u tecmint</strong>

COMMAND  PID    USER   FD   TYPE     DEVICE SIZE/OFF   NODE NAME
sshd    1889 tecmint  cwd    DIR      253,0     4096      2 /
sshd    1889 tecmint  txt    REG      253,0   532336 298069 /usr/sbin/sshd
sshd    1889 tecmint  DEL    REG      253,0          412940 /lib/libcom_err.so.2.1
sshd    1889 tecmint  DEL    REG      253,0          393156 /lib/ld-2.12.so
sshd    1889 tecmint  DEL    REG      253,0          298643 /usr/lib/libcrypto.so.1.0.0
sshd    1889 tecmint  DEL    REG      253,0          393173 /lib/libnsl-2.12.so
sshd    1889 tecmint  DEL    REG      253,0          412937 /lib/libkrb5support.so.0.1
sshd    1889 tecmint  DEL    REG      253,0          412961 /lib/libplc4.so

For more lsof command examples visit 10 lsof Command Examples in Linux.

26. last command

With the last command, we can watch the user’s activity in the system. This command can execute normal users also. It will display complete user’s info like terminal, time, date, system reboot or boot, and kernel version. A useful command to troubleshoot.

<strong># last</strong>

tecmint  pts/1        192.168.50.1     Tue Sep 18 08:50   still logged in
tecmint  pts/0        192.168.50.1     Tue Sep 18 07:59   still logged in
reboot   system boot  2.6.32-279.el6.i Tue Sep 18 07:54 - 11:38  (03:43)
root     pts/1        192.168.50.1     Sun Sep 16 10:40 - down   (03:53)
root     pts/0        :0.0             Sun Sep 16 10:36 - 13:09  (02:32)
root     tty1         :0               Sun Sep 16 10:07 - down   (04:26)
reboot   system boot  2.6.32-279.el6.i Sun Sep 16 09:57 - 14:33  (04:35)
narad    pts/2        192.168.50.1     Thu Sep 13 08:07 - down   (01:15)

You can use last with username to know for specific user’s activity as shown below.

<strong># last tecmint</strong>

tecmint  pts/1        192.168.50.1     Tue Sep 18 08:50   still logged in
tecmint  pts/0        192.168.50.1     Tue Sep 18 07:59   still logged in
tecmint  pts/1        192.168.50.1     Thu Sep 13 08:07 - down   (01:15)
tecmint  pts/4        192.168.50.1     Wed Sep 12 10:12 - 12:29  (02:17)

27. ps command

The ps command displays processes running in the system. The below example show the init to process only.

<strong># ps -ef | grep init</strong>

root         1     0  0 07:53 ?        00:00:04 /sbin/init
root      7508  6825  0 11:48 pts/1    00:00:00 grep init

28. kill command

Use the kill command to terminate the process. First, find process id with ps command as shown below and kill the process with kill -9 command.

<strong># ps -ef | grep init</strong>
root         1     0  0 07:53 ?        00:00:04 /sbin/init
root      7508  6825  0 11:48 pts/1    00:00:00 grep init

<strong># kill- 9 7508</strong>

29. rm command

rm command used to remove or delete a file without prompting for confirmation.

<strong># rm filename</strong>

Use the -i option to get confirmation before removing it. Using options ‘-r‘ and ‘-f‘ will remove the file forcefully without confirmation.

<strong># rm -i test.txt</strong>

rm: remove regular file `test.txt'?

30. mkdir command example.

mkdir command is used to create directories under Linux.

<strong># mkdir directoryname</strong>

This is a handy day-to-day used basic commands in Linux / Unix-like operating system. Kindly share through our comment box if we missed out.

The above is the detailed content of 30 Useful Linux Commands for System Administrators. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

5 Best Open Source Mathematical Equation Editors for Linux 5 Best Open Source Mathematical Equation Editors for Linux Jun 18, 2025 am 09:28 AM

Are you looking for good software to write mathematical equations? If so, this article provides the top 5 equation editors that you can easily install on your favorite Linux distribution.In addition to being compatible with different types of mathema

SCP Linux Command – Securely Transfer Files in Linux SCP Linux Command – Securely Transfer Files in Linux Jun 20, 2025 am 09:16 AM

Linux administrators should be familiar with the command-line environment. Since GUI (Graphical User Interface) mode in Linux servers is not commonly installed.SSH may be the most popular protocol to enable Linux administrators to manage the servers

Gogo - Create Shortcuts to Directory Paths in Linux Gogo - Create Shortcuts to Directory Paths in Linux Jun 19, 2025 am 10:41 AM

Gogo is a remarkable tool to bookmark directories inside your Linux shell. It helps you create shortcuts for long and complex paths in Linux. This way, you no longer need to type or memorize lengthy paths on Linux.For example, if there's a directory

What is a PPA and how do I add one to Ubuntu? What is a PPA and how do I add one to Ubuntu? Jun 18, 2025 am 12:21 AM

PPA is an important tool for Ubuntu users to expand their software sources. 1. When searching for PPA, you should visit Launchpad.net, confirm the official PPA in the project official website or document, and read the description and user comments to ensure its security and maintenance status; 2. Add PPA to use the terminal command sudoadd-apt-repositoryppa:/, and then run sudoaptupdate to update the package list; 3. Manage PPAs to view the added list through the grep command, use the --remove parameter to remove or manually delete the .list file to avoid problems caused by incompatibility or stopping updates; 4. Use PPA to weigh the necessity and prioritize the situations that the official does not provide or require a new version of the software.

Install LXC (Linux Containers) in RHEL, Rocky & AlmaLinux Install LXC (Linux Containers) in RHEL, Rocky & AlmaLinux Jul 05, 2025 am 09:25 AM

LXD is described as the next-generation container and virtual machine manager that offers an immersive for Linux systems running inside containers or as virtual machines. It provides images for an inordinate number of Linux distributions with support

How to create a file of a specific size for testing? How to create a file of a specific size for testing? Jun 17, 2025 am 09:23 AM

How to quickly generate test files of a specified size? It can be achieved using command line tools or graphical software. On Windows, you can use fsutilfilecreatenew file name size to generate a file with a specified byte; macOS/Linux can use ddif=/dev/zeroof=filebs=1Mcount=100 to generate real data files, or use truncate-s100M files to quickly create sparse files. If you are not familiar with the command line, you can choose FSUtilGUI, DummyFileGenerator and other tool software. Notes include: pay attention to file system limitations (such as FAT32 file size upper limit), avoid overwriting existing files, and some programs may

How to install Linux alongside Windows (dual boot)? How to install Linux alongside Windows (dual boot)? Jun 18, 2025 am 12:19 AM

The key to installing dual systems in Linux and Windows is partitioning and boot settings. 1. Preparation includes backing up data and compressing existing partitions to make space; 2. Use Ventoy or Rufus to make Linux boot USB disk, recommend Ubuntu; 3. Select "Coexist with other systems" or manually partition during installation (/at least 20GB, /home remaining space, swap optional); 4. Check the installation of third-party drivers to avoid hardware problems; 5. If you do not enter the Grub boot menu after installation, you can use boot-repair to repair the boot or adjust the BIOS startup sequence. As long as the steps are clear and the operation is done properly, the whole process is not complicated.

NVM - Install and Manage Multiple Node.js Versions in Linux NVM - Install and Manage Multiple Node.js Versions in Linux Jun 19, 2025 am 09:09 AM

Node Version Manager (NVM) is a simple bash script that helps manage multiple Node.js versions on your Linux system. It enables you to install various Node.js versions, view available versions for installation, and check already installed versions.NV

See all articles