My name: Haye Chan
If everyone get a github account then I can turn this repo private. (send me your github id)
- Reference tool: Hypertext C++ tutorial. As you practice, you can use this to quickly look up things you forgot.
Command | Description |
---|---|
ls |
Lists all files and directories in the present working directory |
cd dir |
To change to a particular directory |
cd .. |
Move one level up |
cd ~ |
Move to the home directory |
pwd |
show what directory we are currently at |
cat > filename |
Creates a new file |
cat filename |
Displays the file content |
cp file "new file path" |
Copy the files to the new location |
mv file "new file path" |
Moves the files to the new location |
mv filename new_file_name |
Renames the file to a new filename |
rm filename |
Deletes a file |
mkdir directoryname |
Creates a new directory in the present working directory or a at the specified path |
rmdir directoryname |
Deletes a directory |
mv dir_name new_dir_name |
Renames a directory |
g++ code.cpp |
compile a C++ program to a.out |
./a.out |
Run program a.out in the current folder |
./a.out < in1.txt |
Run a.out and redirect contents of in1.txt as keyboard input |
./a.out > out.txt |
Run a.out and redirect output to out.txt |
python3 script.py |
Run a python script |
python3 script.py < in1.txt |
Run a python script and redirect contents of in1.txt as keyboard input |