LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Some great terminal commands you might want to know. (Along with a description.) (http://www.linuxquestions.org/questions/linux-software-2/some-great-terminal-commands-you-might-want-to-know-along-with-a-description-842886/)

darkstarbyte 11-07-2010 12:57 PM

Some great terminal commands you might want to know. (Along with a description.)
 
Code:

cd
cd is a command that allows you to move between directors. (cd means change directory.) Here are some examples on how to use is:

Code:

cd
This alone takes you back to your home directory.

Code:

cd ~/Desktop/
This takes you to where you desktop folder is. The ~ means home directory if you want to use one command instead of

Code:

cd
cd Desktop

To auto complete file names you use tab.(note: it can not guess the file name if other start with similar beginnings.)

If you want to leave a note in your commands you use #. Example.

Code:

cd # This takes you back to your home directory
If you want to know whats in a file you use:
Code:

ls
ls Lists everything in a directory not hidden if you want to see hidden files you use:

Code:

ls -a
The dash signifies a option. The a option means all and it shows all the the files but not files within files.

Do you want to know how to move files here you go:

Code:

mv ~/Desktop/item ~/place\ for\ this\ item/
If you were wondering mv does mean move how mv works is you type mv the directory to get to the file and the the place you want it to go.

To look up commands:

Code:

man cd
man means manual. Then you type what command you want it to look up if there is a entry for it.

For those who want to make files you use:

Code:

mkdir the
This should make you a directory called the inside the directory your in.

Those of you who want to remove files and directors you use:

Code:

rm # you can use the the -r option to remove directors in linux for bsd you use -rf
rm will remove files but if you want to use the -r option. (side note: rm means remove.)

To copy file use:

Code:

cp ~/document ~/Documents# cp means copy
This will move file document to directory Documents.

That's all I can think of for know I will post later if I can think of more.

(Also if you see errors in what I have said just post what it is and I will fix it)

druuna 11-07-2010 01:53 PM

Hi,

Some points of attention:

Quote:

Code:

cd ~Desktop/

Should be: cd ~/Desktop


Quote:

If you want to know whats in a file you use:
Quote:

ls Lists everything in a file not hidden if you want to see hidden files you use:
Use directory instead of file.


Quote:

For those who want to make files you use:
Code:

mk the

Use directory instead of file.
mk is not a normal Linux command. mkdir is.

eveningsky339 11-07-2010 08:19 PM

They are some useful commands, but a lot are "common sense" to most Linux users, even newer ones. :)

darkstarbyte 11-08-2010 06:17 PM

I could put df, fdisk, fsck, umount, and so on with commands that use the hard drive along with dd, you know the ones if your not careful you can really screw up your computer excluding df.

Only if the ones I posted before are to simple.

Sorry if I am being rude I didn't mean to be.

eveningsky339 11-08-2010 06:32 PM

I didn't find you rude at all. Even if others do, this is just the internet. ;)

XavierP 11-08-2010 06:57 PM

Once this is complete and all proof readers are happy with it, it would be a good idea to post it in the Linux Tutorials section. That way it won't get pushed down the forums. You would also have a dedicated thread opened to discuss the Tutorial.

If you do write it up there, drop me a message via PM or the email contact in my profile and then report your own post to have this closed (to prevent having two discussions).

MTK358 11-08-2010 08:01 PM

What's wrong with this tutorial:

http://linuxcommand.org/

j1alu 11-08-2010 10:37 PM

Yes, i like the first post.
When i started with PC's, not long ago, i would have been happy to get those commands sorted first.
Most of the books i read were way too difficult.
First things first: move around and have a look.
Once one knows that one might search for more advanced documentation.

Perhaps you might add the idea to create a test directoy, say ~/Test or ~/Temp, where one might create, delete, copy and move around without worrying about it.

Good, i like it.


All times are GMT -5. The time now is 07:36 AM.