• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

Useful commands to manage Desktop and Server in Linux - Part 1

62

Useful commands to manage Desktop and Server in Linux

Some useful commands which is less known to manage Desktop and server more efficiently is described in this article with examples.

sudo command

sudo command helps to give you permission denied error. You need not rewrite the entire command it just grabs the last command.

[user1@linuxhelp~]$ yum install vim
Loaded plugins: fastestmirror, refresh-packagekit, security

You need to be root user to install the vim.

[user1@linuxhelp~]$ sudo yum install vim
Loaded plugins: fastestmirror, refresh-packagekit, security
Settingup installing process
- package vim will be installed
&hellip 
&hellip 

python command

The python command helps to generate simple web page over HTTP and access at port 8000 until the interrupt signal is sent.

[root@linuxhelp~]# python -m SimpleHTTPServer

Go to the browser and give localhost:8000 to list the directory for /

Directory_listing

mtr Command

mtr command is the combination of both ping and trace route.

On Debian based Systems

$ sudo apt-get install mtr

On Red Hat based Systems

[root@linuxhelp~]# yum install mtr

Execute the mtr command to start checking the connection between host mtr runs on and google.com

[root@linuxhelp~]# mtr google.com

my_traceroute

emacs editor

It is used to automate the task of administrator to open editor.

Press “ Ctrl-x-e” in terminal prompt and work in editor.

emacs

nl Command

The nl Command denotes the number of lines in a file. The content of file can be listed using cat command.

[root@linuxhelp~]# cat my.txt 
Hello
Linux
centos

Execute “ nl command” to list them in a numbered order.

[root@linuxhelp~]# nl my.txt 
1 hello
2 linux 
3 centos

shuf Command

It is used to randomly select lines/files/folder from a file/folder.

[root@linuxhelp~]# ls 
Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos
[root@linuxhelp~]# ls | shuf (shuffle Input)
Music 
Documents 
Templates 
Pictures 
Public 
Desktop 
Downloads 
Videos
[root@linuxhelp~]# ls | shuf -n1 (pick on random selection)
Public
[root@linuxhelp~]# ls | shuf -n1 
Videos
[root@linuxhelp~]# ls | shuf -n1 
Templates
[root@linuxhelp~]# ls | shuf -n1 
Downloads

ss Command

ss means socket statistics. It is used to display more TCP and state information’ s.

[root@linuxhelp~]# ss 
State      Recv-Q Send-Q      Local Address:Port          Peer Address:Port   
ESTAB      0      0           192.168.1.198:41250        *.*.*.*:http    
CLOSE-WAIT 1      0               127.0.0.1:8000             127.0.0.1:41393   
ESTAB      0      0           192.168.1.198:36239        *.*.*.*:http    
ESTAB      310    0               127.0.0.1:8000             127.0.0.1:41384   
ESTAB      0      0           192.168.1.198:41002       *.*.*.*:http    
ESTAB      0      0               127.0.0.1:41384            127.0.0.1:8000

last Command

It displays the history of last logged in users.

[root@linuxhelp~]# last 
server   pts/0        :0               Tue Oct 22 12:03   still logged in   
server   tty8         :0               Tue Oct 22 12:02   still logged in   
&hellip 
...
(unknown tty8         :0               Tue Oct 22 12:02 - 12:02  (00:00)    
server   pts/0        :0               Tue Oct 22 10:33 - 12:02  (01:29)    
server   tty7         :0               Tue Oct 22 10:05 - 12:02  (01:56)    
(unknown tty7         :0               Tue Oct 22 10:04 - 10:05  (00:00)    
reboot   system boot  3.2.0-4-686-pae  Tue Oct 22 10:04 - 12:44  (02:39)    

wtmp begins Fri Oct  4 14:43:17 2007

curl command

The below command is used to obtain your external IP address into your terminal.

[root@linuxhelp~]# curl ifconfig.me
xx.xx.xx.xx

The above command displays external ip address of my machine, now follow the same step to get your external ip address of your system.
If curl package is not installed, apt/yum command to install package.

tree command

To display current directory in tree format, execute the below command.

[root@linuxhelp~]# tree
. 
|-- Desktop 
|-- Documents 
|   `-- 37.odt 
|-- Downloads 
|   |-- attachments.zip 

|   |-- ttf-indic-fonts_0.5.11_all.deb 
|   |-- ttf-indic-fonts_1.1_all.deb 
|   `-- wheezy-nv-install.sh 
|-- Music 
|-- Pictures 
|   |-- Screenshot from 2013-10-22 12:03:49.png 
|   `-- Screenshot from 2013-10-22 12:12:38.png 
|-- Public 
|-- Templates 
`-- Videos 

10 directories, 23 files

pstree

It is used to display all the processes running currently along with associated child process.

[root@linuxhelp~]# pstree 
init---NetworkManager---{NetworkManager} 
     +-accounts-daemon---{accounts-daemon} 
     +-acpi_fakekeyd 
     +-acpid 
     +-apache2---10*[apache2] 
     +-at-spi-bus-laun---2*[{at-spi-bus-laun}] 
     +-atd 
     +-avahi-daemon---avahi-daemon 
     +-bluetoothd 
     +-colord---{colord} 
     +-colord-sane---2*[{colord-sane}] 
     +-console-kit-dae---64*[{console-kit-dae}] 
     +-cron 
     +-cupsd 
     +-2*[dbus-daemon] 
     +-dbus-launch 
     +-dconf-service---2*[{dconf-service}] 
     +-dovecot---anvil 
     ¦          +-config 
     ¦          +-log 
     +-exim4 
     +-gconfd-2 
     +-gdm3---gdm-simple-slav---Xorg 
     ¦       ¦                  +-gdm-session-wor---x-session-manag---evolution-a+ 
     ¦       ¦                  ¦                  ¦                  +-gdu-notific+ 
     ¦       ¦                  ¦                  ¦                  +-gnome-scree+ 
     ¦       ¦                  ¦                  ¦                  +-gnome-setti+ 
     ¦       ¦                  ¦                  ¦                  +-gnome-shell+++ 
     ¦       ¦                  ¦                  ¦                  +-nm-applet--+++ 
     ¦       ¦                  ¦                  ¦                  +-ssh-agent 
     ¦       ¦                  ¦                  ¦                  +-tracker-min+ 
     ¦       ¦                  ¦                  ¦                  +-tracker-sto+ 
     ¦       ¦                  ¦                  ¦                  +-3*[{x-sessi+ 
     ¦       ¦                  ¦                  +-2*[{gdm-session-wor}] 
     ¦       ¦                  +-{gdm-simple-slav} 
     ¦       +-{gdm3} 
     +-6*[getty] 
     +-gnome-keyring-d---9*[{gnome-keyring-d}] 
     +-gnome-shell-cal---2*[{gnome-shell-cal}] 
     +-goa-daemon---{goa-daemon} 
     +-gsd-printer---{gsd-printer} 
     +-gvfs-afc-volume---{gvfs-afc-volume}

< space> Command

< space> Command can be used to avoid recording the history of commands.

[root@linuxhelp~]#  ls
[root@linuxhelp~]#  pwd
[root@linuxhelp~]#  uname
[root@linuxhelp~]#  echo “ hi” 
[root@linuxhelp~]#  who

Execute history command to check if commands or executed or not.

[root@linuxhelp~]# history
   40  cd /dev/ 
   41  ls 
   42  ping www.google.com 
   43  su

stat Command

stat Command displays the status information of a file or filesystem. It shows the status information’ s like file size, block permissions, access permissions, date time modify or changes etc.

[root@linuxhelp~]# stat 34.odt 

  File: `34.odt'  
  Size: 28822         Blocks: 64         IO Block: 4096   regular file 
Device: 801h/2049d    Inode: 5030293     Links: 1 
Access: (0644/-rw-r--r--)  Uid: ( 1000/     avi)   Gid: ( 1000/     avi) 
Access: 2013-10-14 00:17:40.000000000 +0530 
Modify: 2013-10-01 15:20:17.000000000 +0530 
Change: 2013-10-01 15:20:17.000000000 +0530

< alt> . and < esc> .

To put last command argument at prompt, press and hold ‘ Alt‘ or ‘ Esc‘ and continue pressing ‘ .‘

pv command

pv command is used to echo any kind of text and output in simulating order.

[root@linuxhelp~]# echo " Welcome to linuxhelp.com"  | pv -qL 20
Welcome to linuxhelp.com

mount | column -t

It displays the list of all the mounted filesystem in format with the specifications.

[root@linuxhelp~]# mount | column -t
/dev/sda1    on  /                         type  ext3         (rw,errors=remount-ro) 
tmpfs        on  /lib/init/rw              type  tmpfs        (rw,nosuid,mode=0755) 
proc         on  /proc                     type  proc         (rw,noexec,nosuid,nodev) 
sysfs        on  /sys                      type  sysfs        (rw,noexec,nosuid,nodev) 
udev         on  /dev                      type  tmpfs        (rw,mode=0755) 
tmpfs        on  /dev/shm                  type  tmpfs        (rw,nosuid,nodev) 
devpts       on  /dev/pts                  type  devpts       (rw,noexec,nosuid,gid=5,mode=620) 
fusectl      on  /sys/fs/fuse/connections  type  fusectl      (rw) 
binfmt_misc  on  /proc/sys/fs/binfmt_misc  type  binfmt_misc  (rw,noexec,nosuid,nodev) 
nfsd         on  /proc/fs/nfsd             type  nfsd         (rw)

Clear command

It helps to clean your terminal at once. Option Ctrl+l can also be used to clean.

screen Command

[root@linuxhelp~]# yum install screen

Now press ‘ ?’ help symbol on your keyboard to get help page of screen command and press spacebar on your keyboard to go next page again press space bar to return normal page.
Now press ctrl + A to open another screen.

To list your process running in screen type below command.

[root@linuxhelp~]# screen -ls

file command

It helps to give information about the type of file.

[root@linuxhelp~]# file 34.odt 
34.odt: OpenDocument Text

id command

It helps to print real and effective user and group ids.

[root@linuxhelp~]# id
uid=1000(linux) gid=1000(linux) 
groups=1000(linux),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),109(netdev),111(bluetooth),117(s

Tags:
connor
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

I need the link for part 2

A

https://www.linuxhelp.com/useful-commands-to-manage-desktopserver-part-2/

Q

good way of exploring commands

A

try to keep in touch with us www.linuxhelp.com

Q

Why the curl command is used?

A

The above command displays external ip address of my machine, now follow the same step to get your external ip address of your system.
If curl package is not installed, apt/yum command to install package.

Q

Why the pstree command is using?

A

To list the queries in order to view from the tree shape.

Q

Why the space command is used?

A

Because the space command is used to avoid the history .

Related Tutorials in Useful commands to manage Desktop and Server in Linux - Part 1

Related Tutorials in Useful commands to manage Desktop and Server in Linux - Part 1

FFmpeg Commands in Linux with Examples
FFmpeg Commands in Linux with Examples
Apr 4, 2016
Basic Linux Command Line Tricks
Basic Linux Command Line Tricks
Apr 20, 2016
Useful commands to manage Desktop and Server in Linux - Part 1
Useful commands to manage Desktop and Server in Linux - Part 1
Apr 27, 2016
Useful commands to manage Desktop and Server in Linux - Part 2
Useful commands to manage Desktop and Server in Linux - Part 2
Apr 27, 2016
How to use mkdir, tar and kill commands efficiently in Linux
How to use mkdir, tar and kill commands efficiently in Linux
Apr 19, 2016
Interesting Command Line Tips and Tricks in Linux
Interesting Command Line Tips and Tricks in Linux
Apr 5, 2016
How to run Linux commands every X seconds
How to run Linux commands every X seconds
Mar 25, 2016

Related Forums in Useful commands to manage Desktop and Server in Linux - Part 1

Related Forums in Useful commands to manage Desktop and Server in Linux - Part 1

CentOS
isaiah class=
pidstat no found
May 28, 2018
Basic Commands
FerTah class=
Command sort or uniq
Apr 10, 2019
Windows
Aditya class=
Net view usage in Windows 10
Jul 31, 2019
Basic Commands
gibbson class=
How to install locate command
Aug 25, 2018
Basic Commands
yousuf class=
How to check history command with time
Aug 25, 2018
Basic Commands
raven class=
Basic Commans are not working
Dec 29, 2017
CentOS
muhammad class=
list files on created time
Jun 12, 2018
Basic Commands
elijah class=
How to List only Directories from the Current Location in Linux
Dec 18, 2019
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help legeek ?
Installation of the call center module

hello

I wish to install a call center in virtual with issabel, I downloaded the latest version of it , but I don' t arrive to install the call center module in issabel. please help me

thanks!

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.