Asic Inux Ommands: NOTICE This Is ONLY The Basic List. I Also Offer A List of Commands For
Asic Inux Ommands: NOTICE This Is ONLY The Basic List. I Also Offer A List of Commands For
NOTICE this is ONLY the Basic list. I also offer a list of commands for:
Beginning Server Administration
Files and Permissions
Directory navigation
Commands for Guru-Wannabees
It is my hope that these beginner Linux commands will provide you with a good start to your Linux
command line adventures.
TIP 1:
All of these commands should work from your command prompt (regardless which shell you're
using). Just in case some folks were not aware, you MUST press enter to invoke the command
TIP 2:
For this summary, please note that the EX: stands for example and is not part of the command.
Commands are denoted in courier type font.
TIP 3:
If you need help understanding what the options are, or how to use a command, try adding this to
the end of your command: --help
Use date to set your Type date followed by the two digit month, the two digit date, the
two digit time, and two digit minutes. The syntax is easy enough
and resembles this: MMDDhhmm
This command is helpful but must be used when superuser or
logged in as root.
Typing finger allows you to see who else is on the system or get
detailed information about a person who has access to the system.
Use finger to see who's Type finger followed by the name of a user's account to get
information about that user. Or, type finger and press enter to see
on the system
who's on the system and what they are doing. Ex:
finger johndoe
Yep, you guessed it, typing logout will log your account out of the
system.
Type logout at the prompt to disconnect from your Linux machine
Use logout to quit using or to logout a particular user session from the system. Keep in mind
that although rudimentary, leaving your critical account logged on
the system
may be a security concern. We always recommend promptly using
logout when you are finished using your root account! Ex:
logout
Use ls to list files and Type ls to see a list of the files and directories located in the
directories current directory. If you’re in the directory named games and you
type ls, a list will appear that contains files in the games directory
and sub-directories in the games directory. Examples:
ls Mail
ls /usr/bin
Type ls -alt to see a list of all files (including .rc files) and all
directories located in the current directory. The listing will include
detailed, often useful information. Examples:
ls -alt
ls -alt /usr/bin
If the screen flies by and you miss seeing a number of files, try
using the |more at the end like:
ls -alt |more
Type more followed by the name of a text file to read the file’s
Use more to read the contents. Why do we exmphasize using this on a "text" file?
Because most other types of files will look like garbage! Ex:
contents of a file
more testfile.txt
Typing nano will start a basic text editor on most Linux systems.
Type nano followed by the filename you wish to edit. This basic
editor is quick and easy to use for beginners. However, it is very
Use nano to start a text important that you also learn about other text editors available on
editor Linux and UNIX systems. Click on this link to learn about others
like emacs, vi, and pico. Ex:
nano /etc/security/access.conf
Type passwd and press enter. You'll see the message Changing
password for yourname.
At the Old password: prompt, type in your old password .
Then, at the Enter new password: prompt, type in your new
password .
The system double checks your new password. Beside the Verify:
Use passwd to change your prompt, type the new password and press again.
current password
Create a secure password that combines parts of words and
numbers. For instance, your dog's name may be Rufus. He may
have been born in 1980. Create a password that uses parts of both
the name and date of birth, such as 80rufuS. Note the use of at least
one capital letter. This is a fairly secure password and easy to
remember.
Use pwd to list the name of Type pwd and hit enter. You'll see the full name of the directory
you are currently in. This is your directory path and is very handy.
This is especially handy when you forget which directory you’ve
your current directory
changed to and are trying to run other commands.
Manipulating Files
http://www.reallylinux.com/docs/files.shtml
This page is intended to help the Linux newbie come up to speed on core file handling commands including file permissions.
Brought to you by Mark Rais, our senior editor. To read comands for Directories please click here.
Included in this section are the commands needed to copy, delete, move, and rename files. Security and
permissions are also reviewed below in the chmod command.
A beginner? Then it may help you to type the command ls -alt to list all of your current
files and directories before you start, so you can see your directory and files listed.
Already have experience? Then please skip to Commands for Guru Wanna-bees.
NOTE:
All of these commands should work from your command prompt (regardless which shell you're
using). And of course, if they don't work or help you, I apologize.
# Permission
7 full
6 read and write
5 read and execute
4 read only
3 write and execute
2 write only
1 execute only
0 none
Ex:
cp newfile newerfile
To copy a file to a different directory
(without changing th
e file’s name), specify the directory instead
of the new
filename. Ex:
cp newfile testdir
To copy a file to a different directory and
create a new file name, you need to specify a
directory/a new file name. Ex:
cp newfile testdir/newerfile
cp newfile ../newerfile
The .. represents one directory up in the
hierarchy.
Ex:
file emergency3_demo.exe
Ex:
mv oldfile newfile
Ex:
rm newfile
Use the wildcard character to remove several
files at once. Ex:
rm n*
This command removes all files beginning with
n.
Type rm -i followed by a filename if you’d
like to be prompted before the file is
actually removed. Ex:
rm -i newfile
rm -i n*
By using this option, you have a chance to
verify the removal of each file. The -i
option is very handy when removing
a number of files using the wildcard
character *.
This list only has items related to files, but this link will take you to the page related to
commands for directories.