|
Home > Documentation >
Unix
Introduction to Essential Unix/Linux Commands
File Management
cp - copy
files:
copy ./sourcefile ./destinationfile
directories:
copy -r ./uvarobocup ./newguys/<username>
mv - move
The move command is used for renaming files as well. You must
specify the destination filename, even if it is the same as the
original.
* renaming multiple files is hard, ask us if you must do it
mv ./originalfile ./somefolder/originalfile
rm - remove (aka delete)
rm -r foldername/*.txt
Recursive: used on a folder to delete its contents as well.
rm -f filename
Force: will not warn you about anything.
rm -rf foldername
This is the way to wipe out an entire directory structure.
mkdir - make directory
rmdir - remove directory (It must be empty)
Note: I always use rm -rf, but rmdir will remove an empty directory.
Important Concepts:
File extensions: Unix doesn't care about file extensions. Instead, it uses
a system of permissions. Always remember that Unix is
designed around the concept of having multiple users logged into a
single machine.
Permissions
Read, write, and execute permission exist for user (owner),
group (robocup), and all (other).
Path
Just because a program called myprog is in your current directory doesn't mean typing myprog will
run it (as it would in DOS). You may need to type ./myprog ./myprog refers
to the current directory. So ./myprog is a path to a file in the current directory. This is done for security
purposes on some servers, so you may find that you can run things without ./ sometimes.
It's a good idea to get in the habit of using it.
Background
When you enter a command at the command line to start a program, you can have it start in the background by putting an & at the
end of the line (typically after one or more spaces). That way you will still have your command prompt.
This is incredibly useful when using ssh to connect to the machines, as you will most likely be doing.
Otherwise, your SecureCRT session will be frozen until the program
exits.
Exceed
Exceed is an X server for windows. When a graphical application
runs in unix (like the soccer monitor or kdevelop) it connects to an X
server to display its GUI. Normally, that is on the machine where
the program is running. This will not normally be the case for you
guys, so you will need to use Exceed. To get it working properly,
run Exceed. Right click on its icon in the taskbar and select
Tools : Configuration. Open up Screen Definition and change Window
Mode from Single to Multiple (after all, you want to be able to run a
soccermonitor and kdevelop at the same time).
export Display
You can't all sit at paisley, and matthews doesn't even have a display
attached. You can use the command
export DISPLAY=labpcxx:0.0
to indicate that you want to display on labpcxx. In Unix, you can have multiple monitors, and multiple
desktops on each monitor. Thus, 0.0 means the 0th monitor and the 0th desktop.
It is important to realize that this is relevant only for applications
with GUI's.
Mapping your CS account to a lab computer (makes life easier sometimes)
In explorer, click Tools : Map Network Drive
Click "connect using a different username"
Enter your username and password
for Folder, enter \\apollo\jmm9gc
apollo is one of the fileservers. One other one is athena. If
neither of these works, send us email and we'll figure out the right
one.
|