496
edits
Line 67: | Line 67: | ||
Some more unix commands: | Some more unix commands: | ||
=== who === | |||
The command 'who' lists all the users on the system, what pts they're on, the time they logged on and the machine they logged on from. | The command 'who' lists all the users on the system, what pts they're on, the time they logged on and the machine they logged on from. | ||
=== ls === | |||
The command 'ls' simply lists all your files in the folder that you are in, One point, there can be 'hidden' files in a folder. Their names begin with a "." They aren't really hidden, it's just that ls won't see them, unless you tell it to look for them by using the command: | The command 'ls' simply lists all your files in the folder that you are in, One point, there can be 'hidden' files in a folder. Their names begin with a "." They aren't really hidden, it's just that ls won't see them, unless you tell it to look for them by using the command: | ||
Line 83: | Line 83: | ||
will give a detailed listing of all files in your current folder, including 'hidden' files. | will give a detailed listing of all files in your current folder, including 'hidden' files. | ||
=== cd === | |||
I've already covered this in a way, it changes your current folder or 'working directory' as is the proper name for it. Some examples: | I've already covered this in a way, it changes your current folder or 'working directory' as is the proper name for it. Some examples: | ||
Line 103: | Line 103: | ||
changes to your home directory | changes to your home directory | ||
=== mkdir === | |||
This command simply creates a directory. You can only create directories in directories that you have permission to write to, such as your home directory, or /tmp for example. Some examples: | This command simply creates a directory. You can only create directories in directories that you have permission to write to, such as your home directory, or /tmp for example. Some examples: | ||
Line 115: | Line 115: | ||
does the same, only puts it in your home directory, regardless of whether your home directory is your working directory or not | does the same, only puts it in your home directory, regardless of whether your home directory is your working directory or not | ||
=== cp === | |||
The command cp is used to copy files around the place. There are two arguments you must pass to cp, the source file (the one you want to copy) and the target file (the file you want to copy it to). That sounds confusing but it's not really. When you copy a file, you can specify a directory as the target, that way the file will be copied with the same name into that directory. Some examples will show this better: | The command cp is used to copy files around the place. There are two arguments you must pass to cp, the source file (the one you want to copy) and the target file (the file you want to copy it to). That sounds confusing but it's not really. When you copy a file, you can specify a directory as the target, that way the file will be copied with the same name into that directory. Some examples will show this better: | ||
Line 136: | Line 136: | ||
which will copy the directory 'images' out of 'project' to your home directory | which will copy the directory 'images' out of 'project' to your home directory | ||
=== mv === | |||
The command mv moves files between folders, and can move folders themselves. Its usage is very similar to that of cp. in fact it's the same, only it deletes the source file, leaving the target file. That is, if you mv one file into another folder, the new file will remain, while the old one is deleted, in effect, a 'move'. mv is also used to rename files. Some examples: | The command mv moves files between folders, and can move folders themselves. Its usage is very similar to that of cp. in fact it's the same, only it deletes the source file, leaving the target file. That is, if you mv one file into another folder, the new file will remain, while the old one is deleted, in effect, a 'move'. mv is also used to rename files. Some examples: | ||
Line 152: | Line 152: | ||
moves the directory ~/project into ~/oldstuff | moves the directory ~/project into ~/oldstuff | ||
=== rm === | |||
The command rm is used to delete files. Be careful with this command as once you remove a file, you've lost it unless you made a backup of it. The command is easy to use, an example is: | The command rm is used to delete files. Be careful with this command as once you remove a file, you've lost it unless you made a backup of it. The command is easy to use, an example is: | ||
Line 160: | Line 160: | ||
to delete the file 'hello.txt' out of your home directory | to delete the file 'hello.txt' out of your home directory | ||
=== pwd === | |||
One of the simpler commands, simply typing pwd at the prompt will display your current working directory. 'pwd' stands for 'print working directory'. | One of the simpler commands, simply typing pwd at the prompt will display your current working directory. 'pwd' stands for 'print working directory'. | ||
=== cat === | |||
This stands for concatenate. This command is really useful, if you have a text file you want to view without going into a text editor, you can simply type, for example: | This stands for concatenate. This command is really useful, if you have a text file you want to view without going into a text editor, you can simply type, for example: |
edits