Wednesday, May 25, 2016

Bas!c Shell Comm@nds for Linux Newbies


The basic commands are the ones that you have to know in order to trot around on Linux. These can further be divided into a few sub sections.

Directory Commands
pwd: Used to print a working directory
mkdir: Used to make directories
: It stands for �Change Directory�
rmdir: For removinga directory.

File Commands

ls: This lists the contents ofa directory.
rm: This removes files froma directory.
cp: It copies files from a source directory to the target directory.
mv: It movesthe fileto a target.
: This command rds one or more files and then prints them to the standard output.
cmp: This command compares two files byte by byte.
wc: This command prints the of bytes, new lines and words in a file.
du: This command gives an estimation of the usage by ch file and recursively for directories.
find: This command srches for a file in the directory.
grep: Print the lines that match a particular pattern.
sort: Sort the lines in text files.

Editor

�Vim� is an advanced and more useful text editor than the �Vi� editor. There are also other text editors such as nano, vi, kate, KDE and gedit.

For example, vim filename

User Account

While working on the �root� account, one needs to be very careful. Managing user accounts and groups is one of the most important parts of a system administrator�s task.

When as an admin, you�re given a particular scenario, you must knowhow to managethe various accounts that are involved. Here are some commands that help,

useradd: Crting auser account. This command can be executed only by administrators.
passwd: Changingfor a user. The user will be asked for the old, but administrators can bypass this step.
usermod: This command is used to modify auser account.
userdel: This command is used for deleting anuser accountand files related to it.
groupadd: Crting a new group.
groupdel: This onedeletesa group and entries referring to it.
groupmod: This command is used to modify a group.
chown: Use this when you want to change the owner of a file.
chgrp: Changing the ownership of a group.

Network Commands

It is important to know the commands for checking IP address, getting DNS and fordownloading filesfrom the internet.

wget: This is a non-interactive network downloader. When adownloadfails due to network problems, this keeps retying until the entire file has beendownloaded.
ping: This one sends an ICMP echo request to all network hosts. The sender gets an ICMP packet if the host is responding.
hostname: This is used to set or show the host name for the system.
dnsdomainname: This is for showing the DND domain name of the system.
netstat: This command displays the status of different ports.
ifconfig: This command can be used to get the subnet mask and IP address of a network. Plus, you can use it to configure a particular network.

There are other commands that you need to know too, but this will get you started. Further egories are also made forLinux commands.

No comments:

Post a Comment