NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home > News > Linux > Other Tips, Tricks and Tutorials

Other Tips, Tricks and Tutorials


Basic Linux Commands

Day by Day Linux Console Commands

By Marius Nestor, Linux Editor

24th of August 2006, 14:13 GMT

Adjust text size:


Linux commands are still and they will always be very useful in a Linux system. I will try to list here, for linux beginners, some of the most important console commands:

Starting & Stopping

shutdown -h now - Shutdown the system now and do not reboot.

halt - Stop all processes - same as above.

shutdown -r 5 - Shutdown the system in 5 minutes and reboot.

shutdown -r now - Shutdown the system now and reboot.

reboot - Stop all processes and then reboot - as above.

startx - Start the X system.

Accessing & mounting file systems

mount -t iso9660 /dev/cdrom /mnt/cdrom - Mount the device cdrom and call it cdrom under the /mnt directory.

mount -t msdos /dev/hdd /mnt/ddrive - Mount hard disk "d" as a msdos file system and call it ddrive under the /mnt directory.

mount -t vfat /dev/hda1 /mnt/cdrive - Mount hard disk "a" as a VFAT file system and call it cdrive under the /mnt directory.

umount /mnt/cdrom - Unmount the cdrom

Finding files and text within files

find / -name fname - Starting with the root directory, look for the file called fname.

find / -name "*fname*" - Starting with the root directory, look for the file containing the string fname

locate missingfilename - Find a file called missingfilename using the locate command - this assumes you have already used the command updatedb (see next).

updatedb - Create or update the database of files on all file systems attached to the linux root directory.

which missingfilename - Show the subdirectory containing the executable file called missingfilename.

grep textstringtofind - Starting with the directory called dir, /dir look for and list all files containing textstringtofind.

Moving, copying, deleting & viewing files

ls -l - List files in current directory using long format.

ls -F - List files in current directory and indicate the file type.

ls -laC - List all files in current directory in long format and display in columns.

rm name - Remove a file or directory called name.

rm -rf name - Kill off an entire directory and all that includes files and subdirectories.

cp filename /home/dirname - Copy the file called filename to the /home/dirname directory.

mv filename /home/dirname - Move the file called filename to the /home/dirname directory.

cat filetoview - Display the file called filetoview.

man -k keyword - Display man pages containing keyword.

more filetoview - Display the file called filetoview one page at a time, proceed to next page using the spacebar.

head filetoview - Display the first 10 lines of the file called filetoview.

head -20 filetoview - Display the first 20 lines of the file called filetoview.

tail filetoview - Display the last 10 lines of the file called filetoview.

tail -20 filetoview - Display the last 20 lines of the file called filetoview.

Installing software for Linux

rpm -ihv name.rpm - Install the rpm package called name.

rpm -Uhv name.rpm - Upgrade the rpm package called name.

rpm -e package - Delete the rpm package called package.

rpm -l package - List the files in the package called package.

rpm -ql package - List the files and state the installed version of the package called package.

rpm -i --force package - Reinstall the rpm package called package having deleted parts of it (not deleting using rpm -e).

tar -zxvf archive.tar.gz or tar -zxvf archive.tgz - Decompress the files contained in the zipped and tarred archive called archive

./configure - Execute the script preparing the installed files for compiling.

User Administration

adduser accountname - Create a new user call accountname.

passwd accountname - Give accountname a new password.

su - Log in as superuser from current login.

exit - Stop being superuser and revert to normal user.

Read by 19,675 user(s) | Add comment | Link to this article TWEET THIS


Article rating:
Good (3.7/5) 25 vote(s)    

Subscribe to news | Print article | Send to friend

© Copyright 2001-2010 Softpedia
Contact:

 

 

SEARCH THE NEWS ARCHIVE :




Today's News
| Yesterday's News | News Archive


MORE RELATED ARTICLES:


How to Install XGL on Fedora Core

Fedora Desktop Customization

Fedora Core 5 Installation Guide

Debian Installation Guide

Installing A Linux Distro to An USB Drive

Flash Player for Linux

Configuring the Ethernet Interface from The Command Line

How-to Use Your Partitions in Linux

User opinions:

No user comments yet.
Be the first to express your opinion using the form below!

Share your opinion:

Your Name:
Your Email Address:
(will not be used for commercial purposes)
Solve this to prove you're not a bot: =
Your review/opinion:

 




Windows tabGames tabDrivers tabMac tabLinux tabScripts tabMobile tabHandheld tabGadgets tabNews tab

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM