du
command is verbose and confusing if you run it without options. Here is how to get a human-readable output and a grand total for the path argument (omit for current directory).
du -hc
tr "\r" "\n" < input.tab >.converted.tab
paste -s -d'#######\n' commands | sed "s/#/ \&\& /g" > commands8
.bashrc
or similar bash startup script:
export PS1='\w\$ '
cat yourfile.txt
cd put/target/directory/here
Changes the working directory to whatever path is typed after cd. Without an additional argument, cd brings one back to the home directory.
fgrep "words" yourfile.txt
Print only lines in a file containing the given "words" in a particular file.
find word*
Locates and gives file names of all files in the working directory containing word in the beginning of the file name. The * represents a wildcard so it can be placed before, after, or both in order to find files that contain the given query in a particular part of the file name.
kill process
Ends a particular process. Note that you can type killall to end multiple processes that match the name that is input.
ls
Lists the contents of the working directory.
mkdir directoryname
Makes a directory with a name specified by the user.
nl yourfile.txt
Numbers all the lines of a file.
ps
Lists all process currently running.
pwd
Prints the working directory path to the console.
rm yourfile.txt
Deletes a given file.
rmdir yourdirectory
Deletes a given directory.
source yourfile
Reads and executes commands from the given file in the current environment.
which yourprogram
Prints the the full path of the program to the console (note that its directory must be in your PATH). Adding an -a after which prints all instances of the program.
python3
via Bash, it searches all file directories listed in your PATH in order to execute that command. Errors such as "command not found" (Linux) or "not recognized as an internal or external command, operable program or batch file" (Windows) when you try to invoke something mean you need to add the directory containing that program to your PATH.
echo %path%
shows everything in your PATH on Windows while echo $PATH
does the same for Linux/Unix systems.
PATH=$PATH:~/your/directory/here
and PATH=~/your/directory/here:$PATH
add the given directory to the end or the beginning of your PATH variable list, since when you invoke a command, the directories will be searched from beginning to end and the first match will be what is invoked. This is for Linux/Unix.
The Windows equivalent on Cmder is PATH=%PATH%;C:\your\directory\here
.
Barrick Lab > ComputationList > ProtocolsUnixCommandsQuickReference