Difference: CommonUnixCommands (1 vs. 31)

Revision 31
28 May 2010 - Main.SarahHeim
Line: 1 to 1
 
META TOPICPARENT name="Trash.Trash/Tier3WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 146 to 146
 
sed -i 's/dog/Stinktier/g' words.txt 
replaces "dog" with "Stinktier" within the textfile "words.txt"
Changed:
<
<
>
>

To find the host name of the computer you're working on.

Just open a terminal and type
hostname
 

-- SarahHeim - 26 Jan 2009 -- JennyHolzbauer - 14 Jul 2008
Revision 30
19 Oct 2009 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="Trash.Trash/Tier3WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 90 to 90
  NOTE: at CERN, passwords are now changed online, not with this command.

The grep Command: locating a phrase

Changed:
<
<
grep 'phrase'
This command will search the current directory for the term phrase and return the names of files it is contained within (as well as the interior of the file, around where it is located).
grep -r 'phrase'
>
>
grep 'phrase' ./
This command will search the current directory (the dot-slash at the end of the line) for the term phrase and return the names of files it is contained within (as well as the interior of the file, around where it is located).
grep -r 'phrase' ./
  This does the same thing, but will search subsequent directories as well
Changed:
<
<
grep -h 'phrase'
>
>
grep -h 'phrase' ./
  This lists other options for this function Note: this command has quite a lot of usage options beyond this, feel free to google grep and learn more.
Revision 29
16 Oct 2009 - Main.TomRockwell
Line: 1 to 1
Changed:
<
<
META TOPICPARENT name="Trash.Tier3WebHome"
>
>
META TOPICPARENT name="Trash.Trash/Tier3WebHome"
 

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang For additional bash commands, see http://ss64.com/bash/.
Revision 28
13 Oct 2009 - Main.ChipBrock
Line: 1 to 1
Changed:
<
<
META TOPICPARENT name="WebHome"
>
>
META TOPICPARENT name="Trash.Tier3WebHome"
 

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang For additional bash commands, see http://ss64.com/bash/.
Revision 27
02 Sep 2009 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Added:
>
>
For additional bash commands, see http://ss64.com/bash/.
 

Some General Information

Top Directory: The top (or root) directory starts with a /, such as /work or /home. If a directory location does not start with a slash, such as unix/newfiles, then this directory chain is located within the currect directory (so if the currect directory is /home/user, then the full location of this sub directory is /home/user/unix/newfiles)
Revision 26
23 Mar 2009 - Main.SarahHeim
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 60 to 60
 
cp file1 file2
This command makes a copy of file1 called file2
Added:
>
>
cp -R dirtocopy/ newdir/
This copies an entire directory.
 

The scp Command: copying files/directories to another server

This is how to copy files:
scp SourceFile user@host:directory/TargetFile
Revision 25
17 Mar 2009 - Main.SarahHeim
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 18 to 18
 
ls -a
shows all of the files, including files that begin with a period, such as .bashrc
ls -l
Changed:
<
<
shows the files ordered by the filename, and also informs you as to whether they are readable, writeable or executable (rwx), the user, and the file size. If there are directories, the full size is not shown- instead it usually gives the number 4096.
>
>
shows the files ordered by the filename, and also informs you as to whether they are readable, writeable or executable (rwx), the user, the last time when they were changed, and the file size. If there are directories, the full size is not shown- instead it usually gives the number 4096.
 
ls -ltr
shows the same information as with -l, but the files are ordered by the time that they were created
ls -color
Revision 24
06 Mar 2009 - Main.SarahHeim
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 60 to 60
 
cp file1 file2
This command makes a copy of file1 called file2
Added:
>
>

The scp Command: copying files/directories to another server

This is how to copy files:
scp SourceFile user@host:directory/TargetFile
or
scp user@host:directory/SourceFile TargetFile
This is how to copy an entire directory:
scp -rp directory/ remotehost:

 

The ln Command: linking files

ln -s file1 file2
This command makes a "soft" link of file1 called file2, so file1 is the original file name and location, and file2 is the new link name and location. "Soft" just means that it won't take up extra memory in the directory it is linked to, unlike an actual copy. If you do an ls -ltr, the link will show up in light blue, with an arrow pointing to the original file. You can also remove a link without removing the original file. However, if you remove the original file, or move it to a new location, the link will be broken, and will show up in red highlight if you do an ls -ltr.
Revision 23
06 Mar 2009 - Main.SarahHeim
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Revision 22
04 Feb 2009 - Main.SarahHeim
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Revision 21
29 Jan 2009 - Main.SarahHeim
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 115 to 115
 

How to write a script to automize stuff

Changed:
<
<
start with:
!/bin/bash
>
>
start with:
#!/bin/bash
  comment out with:
#
now you can use all your normal shell commands
run your script by just typing in the name
Revision 20
26 Jan 2009 - Main.SarahHeim
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 128 to 129
 
sed
sed 's/dog/Stinktier/g' words.txt > words2.txt 
copies "words.txt" to "words2.txt" but substitutes every occurence of "dog" for "Stinktier"
Added:
>
>
sed -i 's/dog/Stinktier/g' words.txt 
replaces "dog" with "Stinktier" within the textfile "words.txt"
 

Revision 19
26 Jan 2009 - Main.SarahHeim
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 110 to 110
 
nohup nice python pyprogram.py &
The nice command reduces the priority of what you are running. If your program will take a long time or a lot of CPU, it will be appreciated by other users if you use this command.
Added:
>
>

The ps command: shows processes running on your machine

ps-aux shows processes of all users, username, %CPU, start time, status and more.
 
Added:
>
>

How to write a script to automize stuff

 
Changed:
<
<
-- JennyHolzbauer - 14 Jul 2008
>
>
start with:
!/bin/bash
comment out with:
#
now you can use all your normal shell commands
run your script by just typing in the name
you'll have to change the rights so that you can execute your script by typing:
 chmod +x nameOfScript

how to manipulate text files from the command line

echo 'whateverText' >> newFile 
puts "whateverText" into a (newly created) file calles "newFile"
if you want to put text into an already created file, do the same and it will add the text in the end
sed
sed 's/dog/Stinktier/g' words.txt > words2.txt 
copies "words.txt" to "words2.txt" but substitutes every occurence of "dog" for "Stinktier"
 
Deleted:
<
<
-- JennyHolzbauer - 24 Jun 2008
 
Deleted:
<
<
-- EmilyJohnson - 30 Apr 2008
 
Added:
>
>
-- SarahHeim - 26 Jan 2009 -- JennyHolzbauer - 14 Jul 2008 -- JennyHolzbauer - 24 Jun 2008 -- EmilyJohnson - 30 Apr 2008
  -- JennyHolzbauer - 07 Apr 2008
Revision 18
21 Jan 2009 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 101 to 101
 
echo $ROOTSYS
This will whatever the argument points too. For the example, it will return the root system location. $ROOTSYS would also be specified in your .bashrc file, for instance.
Added:
>
>

The nohup Command: keeps program running after logging off

nohup python pyprogram.py &
This command will keep a program running after a logoff. It is particularly useful if you are logged into a computer remotely, as servers have a tendency to log you off after a few hours, whether you want to or not. The & symbol at the end causes the program to run in the background.

The nice Command: reduces priority of the thing you are running

Using example above, to make it 'nice':
nohup nice python pyprogram.py &
The nice command reduces the priority of what you are running. If your program will take a long time or a lot of CPU, it will be appreciated by other users if you use this command.
 

-- JennyHolzbauer - 14 Jul 2008
Revision 17
17 Jul 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 38 to 38
 
rmdir dir
This removes the directory dir as long as it is empty. To remove a non-empy directory (and of course, its contents) see below
rm -r dir
Changed:
<
<
This will descend into the directory dir and recursively remove all files and directories therein.
>
>
This will descend into the directory dir and recursively remove all files and directories therein. Be careful! This will remove the whole directory without warning messages, so make sure you really want to remove all of the contents before using.
 
rm -f file
This option will force the removal of file file, without prompting you. Use this with care as you can end up deleting a lot of things by accident. Example of use: rm -rf dir will delete the entire directory dir and its contents without prompting.
Revision 16
16 Jul 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 97 to 97
 
diff file1 file2
This will return lines that are different between the files, by printing out the lines.
Added:
>
>

The echo Command: echos the location

echo $ROOTSYS
This will whatever the argument points too. For the example, it will return the root system location. $ROOTSYS would also be specified in your .bashrc file, for instance.
 

-- JennyHolzbauer - 14 Jul 2008
Revision 15
16 Jul 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 93 to 93
 
df
This will return the location amount of space left on disk.
Added:
>
>

The diff Command: differences in files

diff file1 file2
This will return lines that are different between the files, by printing out the lines.
 

-- JennyHolzbauer - 14 Jul 2008
Revision 14
14 Jul 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 73 to 73
 

The passwd Command: changing password

passwd
This command will start a subprogram that will change your password- it will ask for the current password and then ask for your new password. It will quit if the currect password is incorrect.
Added:
>
>
NOTE: at CERN, passwords are now changed online, not with this command.
 

The grep Command: locating a phrase

grep 'phrase'
Line: 88 to 89
  This will return the location of the kpdf program, even if it is not in the current directory structure. If it can't find it, it will tell you where it could not find it.
Added:
>
>

The df Command: disk space usage

df
This will return the location amount of space left on disk.

-- JennyHolzbauer - 14 Jul 2008
  -- JennyHolzbauer - 24 Jun 2008

-- EmilyJohnson - 30 Apr 2008
Revision 13
24 Jun 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 74 to 74
 
passwd
This command will start a subprogram that will change your password- it will ask for the current password and then ask for your new password. It will quit if the currect password is incorrect.
Added:
>
>

The grep Command: locating a phrase

grep 'phrase'
This command will search the current directory for the term phrase and return the names of files it is contained within (as well as the interior of the file, around where it is located).
grep -r 'phrase'
This does the same thing, but will search subsequent directories as well
grep -h 'phrase'
This lists other options for this function Note: this command has quite a lot of usage options beyond this, feel free to google grep and learn more.

The which Command: locating an executable

which kpdf
This will return the location of the kpdf program, even if it is not in the current directory structure. If it can't find it, it will tell you where it could not find it.

-- JennyHolzbauer - 24 Jun 2008
  -- EmilyJohnson - 30 Apr 2008

-- JennyHolzbauer - 07 Apr 2008 \ No newline at end of file
Revision 12
16 May 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 67 to 67
 

The chmod Command: change file permissions

chmod a+rwx file 
This command changes the permissions so that the file is readable, writable, and executable by everyone. If you can't open a file, it is probably because the permissions are set incorrectly. If you can't run a program, it is probably not set as executable. You can also be more precise about it and only change the u, g, or o level and only + or - the r, w, or x label, so to make the o level executable I might say
Changed:
<
<
chmod a+x file 
>
>
chmod o+x file 
  where earlier the "a" stood for all (u, g and o).

The passwd Command: changing password

Revision 11
16 May 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 67 to 67
 

The chmod Command: change file permissions

chmod a+rwx file 
This command changes the permissions so that the file is readable, writable, and executable by everyone. If you can't open a file, it is probably because the permissions are set incorrectly. If you can't run a program, it is probably not set as executable. You can also be more precise about it and only change the u, g, or o level and only + or - the r, w, or x label, so to make the o level executable I might say
Changed:
<
<
chmod o+x file 
>
>
chmod a+x file 
  where earlier the "a" stood for all (u, g and o).

The passwd Command: changing password

Revision 10
15 May 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang
Line: 60 to 60
 
cp file1 file2
This command makes a copy of file1 called file2
Added:
>
>

The ln Command: linking files

ln -s file1 file2
This command makes a "soft" link of file1 called file2, so file1 is the original file name and location, and file2 is the new link name and location. "Soft" just means that it won't take up extra memory in the directory it is linked to, unlike an actual copy. If you do an ls -ltr, the link will show up in light blue, with an arrow pointing to the original file. You can also remove a link without removing the original file. However, if you remove the original file, or move it to a new location, the link will be broken, and will show up in red highlight if you do an ls -ltr.
 

The chmod Command: change file permissions

chmod a+rwx file 
This command changes the permissions so that the file is readable, writable, and executable by everyone. If you can't open a file, it is probably because the permissions are set incorrectly. If you can't run a program, it is probably not set as executable. You can also be more precise about it and only change the u, g, or o level and only + or - the r, w, or x label, so to make the o level executable I might say
Revision 9
05 May 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Changed:
<
<
Feel free to add commands, change the formating, or otherwise modify this page.
>
>
Feel free to add commands, change the formating, or otherwise modify this page. Recommended UNIX book: Learning the UNIX Operating System, Fifth Edition, by by Jerry Peek, Grace Todino-Gonguet, and John Strang

Some General Information

Top Directory: The top (or root) directory starts with a /, such as /work or /home. If a directory location does not start with a slash, such as unix/newfiles, then this directory chain is located within the currect directory (so if the currect directory is /home/user, then the full location of this sub directory is /home/user/unix/newfiles)

Wildcards: When using Unix commands, you can refer to multiple objects using wildcards. For instance, if you want to move all the pdf files in the currect directory into a second directory dir2, you would say
mv *.pdf dir2
The * wildcard refers to multiple characters, so, in the example, any characters are allowed in the filename as long as it ends in .pdf. This is probably the most used wildcard. Additional wildcards are ?, which means "any single character", and the range wild card. The range wildcard works like this. Say I want to view all of the files and directories that start with any letter from a to h. I would say
ls [a-h]*
where the * wildcard allows for the rest of the filename to be whatever it happens to be. Note that this will also result in applying ls to any directories within that a-h first letter range, not just files, and the directory list will not have any restrictions on the files displayed (it will display all of them, not just ones that start with a-h)
 

The ls Command: file information

ls
This shows a list of the files in the current directory. There is a variety of different information you can get out of this command, depending on how you call it. For instance,
ls -a
shows all of the files, including files that begin with a period, such as .bashrc
Added:
>
>
ls -l
shows the files ordered by the filename, and also informs you as to whether they are readable, writeable or executable (rwx), the user, and the file size. If there are directories, the full size is not shown- instead it usually gives the number 4096.
 
ls -ltr
Changed:
<
<
shows the files ordered by the time that they were created, and also informs you as to whether they are readable, writeable or executable (rwx), the user, and the file size. If there are directories, the full size is not shown- instead it usually gives the number 4096.
>
>
shows the same information as with -l, but the files are ordered by the time that they were created
 
ls -color
color-codes the contents according to type of file.
Line: 33 to 44
 

  • note: removing symbolic links with these commands can be a little aggravating, especially if you use tab complete. Say you had a symbolic link named 'blah'. If you try 'rm blah/' it gives you an error that says blah/ is a directory and therefore rm cannot remove it. If, on the other hand, you were to try 'rmdir blah/', it tells you that blah/ is indeed not a directory and rmdir cannot remove it. So what do you do? You use 'rm blah' without the '/'.
Added:
>
>

The mkdir Command: making directories

mkdir dir
This command makes a new directory, dir, in the current directory (unless you list the whole location, from the root directory down, such as /home/root/dir)

The mv Command: moving things (aka renaming or relabeling things)

mv file1 file2
This command "moves" file1 to file2. This is the same as renaming file1, as long as file2 does not exist. In reality, the file is not moved, but the label used to refer to it is.
mv dir1 dir2
This command moves directory dir1 into dir2. Now, there is dir2/dir1, where dir1 still contains all of the files and subdirectories it did before the move
mv dir1 dir2
This command moves directory dir1 into dir2. Now, there is dir2/dir1, where dir1 still contains all of the files and subdirectories it did before the move

The cp Command: copying files

cp file1 file2
This command makes a copy of file1 called file2

The chmod Command: change file permissions

chmod a+rwx file 
This command changes the permissions so that the file is readable, writable, and executable by everyone. If you can't open a file, it is probably because the permissions are set incorrectly. If you can't run a program, it is probably not set as executable. You can also be more precise about it and only change the u, g, or o level and only + or - the r, w, or x label, so to make the o level executable I might say
chmod o+x file 
where earlier the "a" stood for all (u, g and o).

The passwd Command: changing password

passwd
This command will start a subprogram that will change your password- it will ask for the current password and then ask for your new password. It will quit if the currect password is incorrect.
  -- EmilyJohnson - 30 Apr 2008

-- JennyHolzbauer - 07 Apr 2008 \ No newline at end of file
Revision 8
30 Apr 2008 - Main.EmilyJohnson
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page.
Revision 7
30 Apr 2008 - Main.EmilyJohnson
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page.
Line: 10 to 10
  shows all of the files, including files that begin with a period, such as .bashrc
ls -ltr
shows the files ordered by the time that they were created, and also informs you as to whether they are readable, writeable or executable (rwx), the user, and the file size. If there are directories, the full size is not shown- instead it usually gives the number 4096.
Added:
>
>
ls -color
color-codes the contents according to type of file.
 

The cd Command: changing directories

cd  dir
Line: 19 to 21
 
cd - 
this moves you to the directory you were last in
Added:
>
>

The rm Command: removing files

rm file
This removes the file file. Depending on your settings, it will ask if you are certain you want to remove the file. Be careful when using wildcards as you might be removing more than you'd like!
rmdir dir
This removes the directory dir as long as it is empty. To remove a non-empy directory (and of course, its contents) see below
rm -r dir
This will descend into the directory dir and recursively remove all files and directories therein.
rm -f file
This option will force the removal of file file, without prompting you. Use this with care as you can end up deleting a lot of things by accident. Example of use: rm -rf dir will delete the entire directory dir and its contents without prompting.
  • note: removing symbolic links with these commands can be a little aggravating, especially if you use tab complete. Say you had a symbolic link named 'blah'. If you try 'rm blah/' it gives you an error that says blah/ is a directory and therefore rm cannot remove it. If, on the other hand, you were to try 'rmdir blah/', it tells you that blah/ is indeed not a directory and rmdir cannot remove it. So what do you do? You use 'rm blah' without the '/'.

-- EmilyJohnson - 30 Apr 2008
 

-- JennyHolzbauer - 07 Apr 2008 \ No newline at end of file
Revision 6
16 Apr 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page.
Line: 16 to 16
  This moves you to the directory specified (for instance, dir might be /work/hx5/). By using
cd ../ 
you are moving to the directory directly above the current directory
Changed:
<
<
>
>
cd - 
this moves you to the directory you were last in
 

-- JennyHolzbauer - 07 Apr 2008 \ No newline at end of file
Revision 5
07 Apr 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"
Changed:
<
<

Common Unix Commands

>
>

Common Unix Commands

  Feel free to add commands, change the formating, or otherwise modify this page.

The ls Command: file information

Revision 4
07 Apr 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"
Changed:
<
<

Common Unix Commands

>
>

Common Unix Commands

  Feel free to add commands, change the formating, or otherwise modify this page.
Changed:
<
<

The ls Command: file information

>
>

The ls Command: file information

 
ls
This shows a list of the files in the current directory. There is a variety of different information you can get out of this command, depending on how you call it. For instance,
ls -a
Line: 11 to 11
 
ls -ltr
shows the files ordered by the time that they were created, and also informs you as to whether they are readable, writeable or executable (rwx), the user, and the file size. If there are directories, the full size is not shown- instead it usually gives the number 4096.
Changed:
<
<

The cd Command: changing directories

>
>

The cd Command: changing directories

 
cd  dir
This moves you to the directory specified (for instance, dir might be /work/hx5/). By using
cd ../ 
Revision 3
07 Apr 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"
Changed:
<
<

Common Unix Commands

>
>

Common Unix Commands

  Feel free to add commands, change the formating, or otherwise modify this page.
Added:
>
>

The ls Command: file information

 
ls
This shows a list of the files in the current directory. There is a variety of different information you can get out of this command, depending on how you call it. For instance,
ls -a
shows all of the files, including files that begin with a period, such as .bashrc
ls -ltr
shows the files ordered by the time that they were created, and also informs you as to whether they are readable, writeable or executable (rwx), the user, and the file size. If there are directories, the full size is not shown- instead it usually gives the number 4096.
Changed:
<
<
cd  <dir>
This moves you to the directory specified (for instance, might be /work/hx5/). By using
>
>

The cd Command: changing directories

cd  dir
This moves you to the directory specified (for instance, dir might be /work/hx5/). By using
 
cd ../ 
you are moving to the directory directly above the current directory
Revision 2
07 Apr 2008 - Main.JennyHolzbauer
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Common Unix Commands

Feel free to add commands, change the formating, or otherwise modify this page.
Changed:
<
<
ls
>
>
ls
  This shows a list of the files in the current directory. There is a variety of different information you can get out of this command, depending on how you call it. For instance,
Changed:
<
<
ls -a
>
>
ls -a
  shows all of the files, including files that begin with a period, such as .bashrc
Changed:
<
<
ls -ltr
>
>
ls -ltr
  shows the files ordered by the time that they were created, and also informs you as to whether they are readable, writeable or executable (rwx), the user, and the file size. If there are directories, the full size is not shown- instead it usually gives the number 4096.
Changed:
<
<
cd
>
>
cd  <dir>
  This moves you to the directory specified (for instance, might be /work/hx5/). By using
Changed:
<
<
cd ../
>
>
cd ../ 
  you are moving to the directory directly above the current directory
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback