Difference between revisions of "Basic Linux Commands"
From Montana Tech High Performance Computing
Line 1: | Line 1: | ||
+ | You can use the <code>man</code> command to quickly check the manual of a command/program. For example, to check the manual of the <code>cp</code> command, you can simply do: <code>$ man cp</code> | ||
+ | |||
+ | |||
*To check your current directory use the command: | *To check your current directory use the command: | ||
Revision as of 09:37, 2 March 2018
You can use the man
command to quickly check the manual of a command/program. For example, to check the manual of the cp
command, you can simply do: $ man cp
- To check your current directory use the command:
$ pwd
- Copy an folder to your home directory:
$ cp -r /opt/intro ~
Copy a file to your home directory:
$ cp /opt/intro/helloworld.f ~
The tilde symbol is your home directory
- List the contents of your home directory:
$ ls
- Go to the newly copied directory intro and list contents:
$ cd intro
$ ls
- Create a new folder, testfolder, here
$ mkdir testfolder
$ ls
- Move/Rename a file(or folder)
$ mv helloworld.f helloworld2.f
$ls
$ mv helloworld2.f ./testfolder/
$ ls
$ ls ./testfolder
Here the dot above represents the current directory.
- Go back to your home directory
$ cd
- Delete file/folder
$ ls
$ rm helloworld.f
$ ls
$ rm -r intro
$ ls