Skip to main content

Linux system administration commands




·        
halt
This command shuts down the operating system, but can only be run by the root user.
#halt
reboot
This command shuts down and restarts the operating system. It also can only be run by root.
#reboot           [will perform simple reboot]
#reboot -f        [will perform fast reboot ]
init 0
This command also shuts down the operating system, and can only be run by root.
#init 0
init 6
This command restart the operating system. It also can only be run by root.
#init 6
man
This command opens the manual page for the command or utility specified. The man utility is a very useful tool. If you are unsure how to use any command, use man to access its manual page. For example, you could enter man ls at the shell prompt to learn how to use the ls utility.
#man ls
info
The info utility also displays a help page for the indicated command or utility. The information displayed with info command will be in-depth than that displayed in the man page for the same command.
info ls
su
This command switches the current user to a new user account. For example, if you’re logged in as vickey and need to change to user account to vinita, you can enter su vinita at the shell prompt. This command is most frequently used to switch to the superuser root account. 
In fact, if you don’t supply a username, this utility assumes that you want to change to the root account. If you enter
 su -, then you will switch to the root user account and have all of root’s environment variables applied.
This command require password of the user you want switch.
Looking for Files
There are two basic commands used for file searches: find and locate
find
The find command searches through directories and subdirectories for a desired file. For example, if you wanted to find the directory with thegrub.conf linux boot loader file, you could use the following command, which would start the search in the top-level root (/) directory:
# find / -name grub.conf
But this search took several minutes to get it task done. Alternatively, if you know that this file is located in the /etc subdirectory tree, or /boot/grub/grub.conf you could start in that directory with the following command:
# find /etc -name grub.conf
locate
If this is all too time-consuming, RHEL 5 includes a default database of all files and directories. Searches with the locate command are almost instantaneous. And locate searches don't require the full file name. The drawback is that the locate command database is normally updated only once each day, as documented in the /etc/cron.daily/mlocate.cron script.
Getting into the Files
Now that you see how to find and get around different files, it's time to start reading, copying, and moving the files around. Most Linux configuration files are text files. Linux editors are text editors. Linux commands are designed to read text files. If in doubt, you can check the file types in the current directory with the 
file * command.
cat
The most basic command for reading files is cat. The cat filename command scrolls the text within the filename file. It also works with multiple file names; it concatenates the file names that you might list as one continuous output to your screen. You can redirect the output to the file name of your choice.
more and less
Larger files demand a command that can help you scroll through the file text at your leisure. Linux has two of these commands: 
more and less.
With the more filename command, you can scroll through the text of a file, from start to finish, one screen at a time. With the less filename command, you can scroll in both directions through the same text with the PAGE UP and PAGE DOWN keys. Both commands support vi-style searches.
head and tail
The head and tail commands are separate commands that work in essentially the same way. By default, the head filename command looks at the first 10 lines of a file; the tail filename command looks at the last 10 lines of a file. You can specify the number of lines shown with the -nxswitch. Just remember to avoid the space when specifying the number of lines; for example, the
# tail -n15 /etc/passwd
command lists the last 15 lines of the /etc/passwd file.
cp
The cp (copy) command allows you to take the contents of one file and place a copy with the same or different name in the directory of your choice. For example, the cp file1 file2 command takes the contents of file1 and saves the contents in file2. One of the dangers of cp is that it can easily overwrite files in different directories, without prompting you to make sure that's what you really wanted to do.
mv
While you can't rename a file in Linux, you can move it. The mv command essentially puts a different label on a file. For example, the mv file1 file2 command changes the name of file1 to file2. Unless you're moving the file to a different partition, everything about the file, including the inode number, remains the same.
ln
You can create a linked file. 
linked files are common with device files such as /dev/dvdwriter and /dev/par0. They're also useful for making sure that multiple users have a copy of the same file in their directories. Hard links include a copy of the file. As long as the hard link is made within the same partition, the inode numbers are identical. You could delete a hard-linked file in one directory, and it would still exist in the other directory. For example, the following command creates a hard link from the actual Samba configuration file to
 smb.conf in the local directory:
# ln smb.conf /etc/samba/smb.conf
On the other hand, a soft link serves as a redirect; when you open up a file created with a soft link, you're directed to the original file. If you delete the original file, the file is lost. While the soft link is still there, it has nowhere to go. The following command is an example of how you can create a soft link:
# ln -s smb.conf /etc/samba/smb.conf
sort
You can sort the contents of a file in a number of ways. By default, the sort command sorts the contents in alphabetical order depending on the first letter in each line. For example, the sort /etc/passwd command would sort all users (including those associated with specific services and such) by username.
grep and egrep
The grep command uses a search term to look through a file. It returns the full line that contains the search term. For example, grep 'vickey' /etc/passwd looks for my name in the /etc/passwd file.
The egrep command is more forgiving; it allows you to use some unusual characters in your search, including +, ?, |, (, and). While it's possible to set up grep to search for these characters with the help of the backslash, the command can be awkward to use.
wc
The wc command, short for word count, can return the number of lines, words, and characters in a file. The wc options are straightforward: for example, wc -w filename returns the number of words in that file.
sed
The sed command, short for stream editor, allows you to search for and change specified words or even text streams in a file. For example, the following command changes the first instance of the word Windows to the word Linux in each line of the file data, and writes the result to the file newdata:
# sed 's/Windows/Linux/' data > newdata
However, this may not be enough. If a line contains more than one instance of Windows, the above sed command does not change the second instance of that word. But you can make it change every appearance of Windows by adding a "global" suffix:
# sed 's/Windows/Linux/g' data > newdata
awk
The awk command, named for its developers (Aho, Weinberger, and Kernighan), is more of a database manipulation utility. It can identify lines with a keyword and read out the text from a specified column in that line. Again, using the /etc/passwd file, for example, the following command will read out the username of every user with a vickey in the comment column:
# awk '/vickey/ {print $1}' /etc/passwd
ps
It's important to know what's running on your Linux computer. The ps command has a number of critical switches. When trying to diagnose a problem, it's common to get the fullest possible list of running processes, and then look for a specific program. For example, if the Firefox Web browser were to suddenly crash, you'd want to kill any associated processes. The ps aux | grep firefox command could then help you identify the process(es) that you need to kill.
who and w
If you want to know what users are currently logged into your system, use the who command or the w command. This can help you identify the usernames of those who are logged in, their terminal connections, their times of login, and the processes that they are running.
Wildcards
Sometimes you may not know the exact name of the file or the exact search term. This is when a wildcard is handy. The basic wildcards are shown
Wildcard
Description
*
Any number of alphanumeric characters (or no characters at all). For example, the ls ab* command would return the following file names, assuming they exist in the current directory: ab, abc, abcd.
?
One single alphanumeric character. For example, the ls ab? command would return the following file names, assuming they exist in the current directory: abc, abd, abe
[ ]
A range of options. For example, the ls ab[123] command would return the following file names, assuming they exist in the current directory: ab1, ab2, ab3. Alternatively, the ls ab[X-Z] command would return the following file names, assuming they exist in the current directory: abX, abY, abZ.
env
This command displays the environment variables for the currently logged-in user.
echo
This command is used to echo a line of text on the screen. It’s frequently used to display environment variables. For example, if you wanted to see the current value of the PATH variable, you could enter 
echo $PATH
top
This command is a very useful command that displays a list of all applications and processes currently running on the system. You can sort them by CPU usage, memory usage, process ID number, and which user owns them
which
This command is used to display the full path to a shell command or utility. For example, if you wanted to know the full path to the ls command, you would enter
which ls
whoami
This command displays the username of the currently logged-in user.
netstat
This command displays the status of the network, including current connections, routing tables, etc
route
This command is used to view or manipulate the system’s routing table.
ifconfig
This command is used to manage network boards installed in the system. It can be used to display or modify your network board configuration parameters. This command can only be run by the root user.
Do practice and practice until you feel comfortable with these commands.

Comments

Popular posts from this blog

ഫെയ്‌സ്ബുക്ക് മെസഞ്ചറില്‍ ഇനി ശബ്ദസന്ദേശങ്ങള്‍ ടെക്സ്റ്റാക്കി അയക്കാം

ഫെയ്‌സ്ബുക്ക് മെസഞ്ചറില്‍ ഇനി ശബ്ദം ടെക്സ്റ്റ് മെസേജായി (Voice to Text) അയയ്ക്കാം. ഇതിനൊപ്പം വോയ്‌സ് മെസേജും ഉപയോക്താവിന് കേള്‍ക്കാന്‍ സൗകര്യമുണ്ടാകും. തിരക്കിട്ട സമയങ്ങളില്‍ വോയ്‌സ് മേസേജ് കേള്‍ക്കാന്‍ സമയമില്ലാത്തവര്‍ക്ക് ഉപകാരപ്രദമാകുന്നതാണ് പുതിയ ഫീച്ചര്‍. ഫെയ്‌സ്ബുക്ക് മെസഞ്ചര്‍ വഴി വോയ്‌സ് മെസേജ് അയയ്ക്കുന്നതിന് മുന്നോടിയായി, ശബ്ദസന്ദേശം റിക്കോര്‍ഡ് ചെയ്യാന്‍ മൈക്രോഫോണ്‍ ഐക്കണില്‍ ടാപ്പ് ചെയ്യണം. നിങ്ങള്‍ മെസേജ് അയച്ചുകഴിഞ്ഞാല്‍, ഫെയ്‌സ്ബുക്ക് ആ ശബ്ദസന്ദേശം ടെക്സ്റ്റാക്കി മാറ്റും. വോയ്‌സ് മെസേജിനരികിലുള്ള ഐക്കണില്‍ ടാപ്പ് ചെയ്താല്‍, ശബ്ദസന്ദേശത്തെ ടെക്സ്റ്റില്‍ കാട്ടിത്തരും. സ്പീച്ച് റിക്കഗ്നിഷന്‍ കമ്പനിയായ Wit.ai യെ ഫെയ്‌സ്ബുക്ക് അടുത്തയിടെ സ്വന്തമാക്കിയിരുന്നു. ഇവരുടെ സാങ്കേതികവിദ്യയുടെ അടിസ്ഥാനമാക്കിയാണ് ഫെയ്‌സ്ബുക്ക് മെസഞ്ചറിലെ പുതിയ ഫീച്ചര്‍ വന്നിരിക്കുന്നതെന്നാണ് നിരീക്ഷകര്‍ പറയുന്നത്. പുതിയ ഫീച്ചര്‍ ഇപ്പോള്‍ പരീക്ഷണാടിസ്ഥാനത്തിലാണ്. അധികം വൈകാതെ ഏവര്‍ക്കും ലഭിക്കും. ശബ്ദസന്ദേശം നല്‍കുന്നയാളുടെ ഉച്ഛാരണം, സംസാര രീതി, സംസാര വ്യക്തത തുട...

വെര്‍ടു – ആറരലക്ഷം രൂപക്ക് ഒരു ആന്‍ഡ്രോയ്ഡ് സ്മാര്‍ട്ട്‌ ഫോണ്‍ – ഇപ്പോള്‍ ഇന്ത്യയിലും

എത്ര ലക്ഷവും മുടക്കി ആഡംബര സാദനങ്ങള്‍ വാങ്ങാന്‍ ആളുകള്‍ ഉണ്ടാകും. ഇയൊരു ചിന്തയാണ് വെര്‍ടു എന്ന പേരില്‍ വിലകൂടിയ മൊബൈല്‍ ഫോണ്‍ ശ്രേണി അവതരിപ്പിക്കാന്‍ നോക്കിയയ്ക്ക് പ്രചോദനമായത്. അങ്ങനെ 1998 ല്‍ ആദ്യ വെര്‍ടു ഫോണ്‍ പിറവിയെടുത്തു. ഇന്ദ്രനീലക്കല്ലുകൊണ്ടു കൊത്തിയുണ്ടാക്കിയ കീപാഡും വിലയേറിയ ടൈറ്റാനിയം ലോഹം കൊണ്ട് നിര്‍മിച്ച ബോഡിയുമെല്ലാമുളള വെര്‍ടുവിനെ പണക്കാര്‍ക്ക് പെട്ടെന്നിഷ്ടമാകുകയും ചെയ്തു. പിന്നീടങ്ങോട്ട് ലോകമെങ്ങുമുളള പണച്ചാക്കുകളുടെ കൈയിലെ സ്റ്റാറ്റസ് സിംബലായി വെര്‍ടു മൊബൈല്‍ ഫോണ്‍ മാറി. ഇപ്പോഴിതാ ടി.ഐ. എന്ന സ്മാര്‍ട്‌ഫോണ്‍ മോഡലുമായി വെര്‍ടു ഇന്ത്യയിലുമെത്തിയിരിക്കുന്നു. 6,49,990 രൂപയാണ് വെര്‍ടു ടി.ഐയ്ക്ക് ഇന്ത്യയിലെ വില. 2012 ല്‍ സാമ്പത്തികപ്രതിസന്ധി കാരണം വെര്‍ടുവിന്റെ 90 ശതമാനം ഓഹരികളും നോക്കിയ വിറ്റഴിച്ചു, പക്ഷെ കമ്പനി ഇപ്പോഴും നല്ല രീതിയില്‍ നടക്കുന്നുണ്ട്. കോടീശ്വരന്‍മാര്‍ ഏറെയുള്ള ഗള്‍ഫ് രാജ്യങ്ങളും റഷ്യയുമാണ് വെര്‍ടുവിന്റെ പ്രധാനവിപണി. മാസങ്ങള്‍ കൂടുമ്പോള്‍ ഓരോ മോഡലിറക്കി ആഡംബരവിപണിയിലെ തങ്ങളുടെ സാന്നിധ്യം ...

USB versions

USB 1.1: Released in August 1998, this is the first USB version to be widely adopted (the original version 1.0 never made it into consumer products). It has a top speed of 12Mbps (though in many cases only performs at 1.2Mbps). It's largely obsolete. USB 2.0: Released in April 2000, it has a max speed of 480Mbps in Hi-Speed mode, or 12Mbps in Full-Speed mode. It currently has the max power out put of 2.5V, 1.8A and is backward-compatible with USB 1.1. USB 3.0: Released in November 2008, USB 3.0 has the top speed of 5Gbps in SuperSpeed mode. A USB 3.0 port (and connector) is usually colored blue. USB 3.0 is backward-compatible with USB 2.0 but its port can deliver up to 5V, 1.8A of power. USB 3.1: Released in July 26, 2013, USB 3.1 doubles the speed of USB 3.0 to 10Gbps (now called SuperSpeed+ or SuperSpeed USB 10 Gbps), making it as fast as the original Thunderbolt standard. USB 3.1 is backward-compatible with USB 3.0 and USB 2.0. USB 3.1 has three power profiles (according to ...