10 More Basic Commands For Linux Beginners Part4

By | January 13, 2011

I wish you have been following my part1, part2 and part3 of my linux basic command tutorials. If u have not, then you better check them out first before actually you start looking at the following commands. So, this series begins with 31 and ends with 40. In this session, you will check out basic commands like mkdir, nohup, ping, ps, rm, rmdir, sed, sleep and ssh.

31: mkdir – mkdir creates a directory in the location you specified.

linux@india365:~/work/test1$ ls
afile
linux@india365:~/work/test1$ mkdir dir
linux@india365:~/work/test1$ ls
afile dir

32: nohup – nohup command is used to run background jobs on a remote server ever after you log off from the remote machine. Most usually, you login to the remote servers using ssh. You can use nohup command to start a shell script that can run on the server and logoff. The command still runs even after you logoff from the remote server.

nohup ./sampleshell.sh &

The sampleshell script starts running and the “&’ that follows the command will specify that the command should run in the background.

33: passwd – passwd allows users to change their password.

linux@india365:~/work/test1$ passwd
Changing password for linux.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
Password changed

34: ping – ping sends a icmp request for a destination host and lets you know if the other host is active or inactive on the network.

linux@india365:~/work/test1$ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.936 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.057 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.031 ms
^C
— 127.0.0.1 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2019ms
rtt min/avg/max/mdev = 0.031/0.341/0.936/0.420 ms

35: ps – ps shows the total numbers of processos running on the machine.

linux@india365:~/work/test1$ ps aux | grep head -5
linux 4121 0.8 1.4 38004 15208 ? Sl 00:03 0:01 gnome-terminal
linux 4128 0.0 0.0 2880 732 ? S 00:03 0:00 gnome-pty-helper
linux 4129 0.1 0.2 5740 3048 pts/0 Rs 00:03 0:00 bash
linux 4165 0.1 1.1 22336 12232 ? S 00:04 0:00 /usr/lib/notification-daemon/notification-daemon
linux 4213 0.0 0.0 3716 1028 pts/0 R+ 00:07 0:00 ps aux
linux 4214 0.0 0.0 3120 732 pts/0 R+ 00:07 0:00 grep head -5

36: rm – rm helps you remove files and directories specified.

linux@india365:~/work/test1$ ls
afile dir
linux@india365:~/work/test1$ rm afile
linux@india365:~/work/test1$ ls
dir

37: rmdir – rmdir is used to remove directories only.

linux@india365:~/work/test1$ ls
afile dir
linux@india365:~/work/test1$ rmdir dir/
linux@india365:~/work/test1$ ls
afile

38: sed – This is a stream editor that can help you to transform text from a file or other resources.

linux@india365:~/work/test1$ cat afile
This is vamsi
linux@india365:~/work/test1$ sed s/vamsi/kiran/ afile
This is kiran

39: sleep – sleep is used to keep the system idel from the specified amount of time.

sleep 3

40: ssh – ssh is used to connect to remote servers securely.

ssh -p 22 username@hostname
or
ssh -p 22 root@host-ip-address

If you like this article, then please consider sharing it. Sharing really inspires us to do things much better!!

Leave a Reply

Your email address will not be published. Required fields are marked *