Basic Linux Commands –
cd [directory name] – Change Directory
mkdir [directory name] – Make new Directory
touch [file names] –make new files
ls – lists contents in current directory
pwd – lists current directory
rm [file name] – delete file
cp [file name] [new file name] – copy files
mv [file name] [new file name] – move files
find [string] – searches for files containing the string
grep [string] – searches file contents for the string
emacs [file name] – opens a text editor on the listed file name
scp user@host [source file name][target file name]
[First command] |[Second command] (Piping) – Dumps the output of the first command into the second
#!/bin/tcsh – Must be at the beginning of a bash script
C++
Compiling Files
g++ [filename].cpp - Compiles file
./a.out - Runs file
#Include <iostream> Necessary for text output and input
int main() {
Code
return 0; - Sample necessary formatting
}
cout << "[Text]" << end; - Outputs text
cin >> [text]; - Inputs text
for (int i = 0; i<num; i++){ - For loop example
while(i>0) {
Command While Loop Example
n--;
}
//Single Comment
/*Block Comment*/
Variable Declaration –
Char [Variable]
Int [Variable]
Float [Variable]
Double [Variable]
*[Variable]
Git Commands –
Process to add and update git repositories
git init
git add [file name]
git commit –a –m [commit #]
git push –u origin master
Root Initialization Commands –
Must initialize Xming first and enable X11 forwarding on ssh client
cd ~/CMSSW_5_3_30
cmsenv
root –nw
Root Samples
TH1F *histo1 = new TH1F("histo1","S",50,0.,50.); - Example Histogram
TF1 *fa1 = new TF1("fa1","sin(x)/x",0,10); - Example Graph
[pointer] -> Draw(); Creates the Graph/Histogram