Linux Basics
First, log in to the cluster.
-
Check the node you are connected to
-
Print the current working directory
-
List all files and folders in the current directory
-
Change directory
-
Create a new directory
List of useful linux commands
| Command | Description | Example |
|---|---|---|
ls |
Lists files and directories in the current directory | ls, ls -la |
cd |
Changes the current directory | cd .., cd |
pwd |
Displays the current directory path | pwd |
mkdir |
Creates a directory | mkdir <name> |
touch |
Creates an empty file | touch <name> |
rm |
Removes a file | rm <name>, rm -r <folder> |
cp |
Copies a file | cp <name> <new_directory> |
mv |
Moves or renames a file | mv <name> <new_directory> |
cat |
Displays the contents of a file | cat <name> |
less |
Displays the contents of a file page by page | less <name> |
grep |
Searches for a pattern in a file | grep <pattern> <name> |
chmod |
Changes file permissions | chmod <permissions> <name> |
man |
Displays the manual page for a command | man <command> |