These are some of the more commonly used UNIX commands.
<up/down arrow>
<control>-c
cd
pwd
ls
ls /path/to/other/directory
mkdir bin
ls
ls bin
cd bin
(change back to the "parent" directory, the one just above this in the file system)
cd ..
rm unwantedfile.txt
rm -r unwanteddirectory
unzip zippedfile.zip
wc filename.txt
head myfile.txt
cat filename.txt
cut -f 1-3 myfile.txt
cut -f 1-3 -d "," myfile.txt
(note the use of |
to pipe the output of one command to another)
cut -f 1-3 myfile.txt | head
cut -c 1-20 myfile.txt
cut -c 1-20 myfile.txt | head
less myfile.txt
(note again the use of |
to pipe the output of cut
to less
)
cut -f 1-10 -d "," myfile.txt | less
cp file.txt filecopy.txt
cp file.txt directory_name
cp /full/path/to/other/file.txt .
cp -r directory1 directory2
mv oldname.txt newname.txt
du -hs *
nano somefile.txt
(e.g. print out all lines that have a ">" character)
grep ">" input.fna
(e.g. print lines that DO NOT have a ">" character)
grep -v ">" input.fna
grep -c ">" input.fna
If you need to run something that will take a while, there are ways to keep an interactive computing session open on MSI. One way is to log in to a specific login node (e.g. ahl01
), open a "screen" session, and then start your interactive session. The screen session will stay open on the login node if you disconnect and connect again later. Here are the steps:
- When you first connect to MSI, connect to a specific login node:
ssh username@ahl01.msi.umn.edu
- Start a "screen" session (like opening a browser window, conceptually)
screen
- Launch your compute node
srun ...
- When you need to log off temporarily, detach from the screen session (don't hold ctrl after the
a
)
<ctrl>-a d
Then exit the login node with <ctrl>-d
or exit
.
5. When ready to log back on, connect to the same login node:
ssh username@ahl01.msi.umn.edu
- Re-attach to the screen session
screen -Dr
Now you are back on the compute node, right where you left off. If you had a command running, it will have continued running in the background.
<ctrl>-a c
<ctrl>-a n
<ctrl>-a p
<ctrl>-d
<control>-r (then type the search string)
clear