Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Terminal commands?.....
#1

Greetings! This is my first post [img]<___base_url___>//public/style_emoticons/default/biggrin.png[/img]

 

Soo, where to begin?

 

I'm relatively new to Linux, I have toyed with it a few times in the past. But this time around I'm determined to make the effort to become a life long user.

Sadly I'm one of those people thats completely stuck in the Windows mindset so as you can imagine, right now I'm finding one or two things a little tricky, but I'm getting there slowly.

 

Im sure over the coming days/weeks/month/years I'll have lots more questions for you all, but right now just a quick simple one.

 

I'm using Ubuntu 13.04 (not sure if this makes a difference, although I'm sure you'll tell me if it does or not) I got the terminal open and muddling my way through the commands to navigate through directories (folders in windows speak lol) now much like the windows dos prompt and dos of long ago, I worked out you can change directories using "cd (insert name of directory)" but what I would like to know is how to I change back to the directory I was in previously. To illustrate what I mean, in a dos prompt I would type cd files-here and it will go to that directory then if I want to go to a sub directory I would while in the files-here directory type "cd more-files-here" but then if I want to return to the files-here directory I would simply type "cd.." to go back. I quickly realised this is not the case in a linux terminal. Could anyone tell me how I would navigate to that previous folder. Also if there are any good terminal tutorials I could be linked to to read up on what I'm doing I would be most greatful :)

 

Thanks in advance.

Reply
#2

Hello ultranoob! and welcome to the forums!

 

You can navigate through directories with the cd  command like you said. You can use absolute path or relative path, absolute starting at the root of the filesystem: cd /home/userer/data/pictures and relative starting at the current working directory, cd data/pictures .

 

You can check to see what your current location is in the directory structure by using this command: pwd = print working directory.

 

Another usefull command is ls  command, this list the  files/directories in the current working directory. You can also ls a relative path or absolute path to list the files/directories from a different location.

 

]$ ls /usr/local/
bin  etc  games  include  lib  lib64  libexec  sbin  share  src
 

 

You can also search the  online manual for commands via: man -k keyword(search term) and you can read the manual of each command by putting the word man  in front of the command. man ls

 

 

You can make directories via: mkdir dir-name  or remove an empty directory via rmdir , if the directory is not empty use rm -rf dirname, but becareful when using this command and never use this command rm -rf /* it will wipe your whole filesystem.

 

You can use either nano or vi as command line text editors, although I think nano is standard for ubuntu. I hope that helps you out, a site I found useful is the following site.

 

Hope that helps you on your way :)

Reply
#3

Thanks for the welcome.

 

Also thanks for the help [img]<___base_url___>//public/style_emoticons/default/biggrin.png[/img]

 

Ah ok so man is a little like the /? switch for getting the uses for commands?

Reply
#4

Also thanks for the heads up with not using rm -rf /* lmao

I remember back when i got my first PC using dos I managed to destroy everything by trying to do del .. or something like that, I thought it was a file I didn't need haha.

Reply
#5

Quote:<div>
Thanks for the welcome.

 

Also thanks for the help [img]<___base_url___>//public/style_emoticons/default/biggrin.png[/img]

 

Ah ok so man is a little like the /? switch for getting the uses for commands?

</div>
 

man is to view the entire detail information  about a command. If you want a short help you can use: command --help

 

ie: ls --help

Reply
#6

Quote:<div>
Also thanks for the heads up with not using rm -rf /* lmao

I remember back when i got my first PC using dos I managed to destroy everything by trying to do del .. or something like that, I thought it was a file I didn't need haha.

</div>
 

You can only do this as root or with elevated privileges, but still  it's nice to know not to use it :)You can use rm -rf on any directory you have enough access rights to but it will not ask you if you are sure if you want to delete it and it will delete the directory strutucture recursively, so becareful when using it on your own directory structure.

Reply
#7

Ok brilliant, thanks very much for the help [img]<___base_url___>//public/style_emoticons/default/biggrin.png[/img]

 

Gonna go read through that site you linked me too now, read the first couple of pages and learnt a lot already.

 

Makes me wish i'd persisted with linux before.

Reply
#8
No problem, better late  then never ;):)cheers!
Reply
#9

Quote:<div>
Greetings! This is my first post [img]<___base_url___>//public/style_emoticons/default/biggrin.png[/img]

 

Soo, where to begin?

 

I'm relatively new to Linux, I have toyed with it a few times in the past. But this time around I'm determined to make the effort to become a life long user.

Sadly I'm one of those people thats completely stuck in the Windows mindset so as you can imagine, right now I'm finding one or two things a little tricky, but I'm getting there slowly.

 

Im sure over the coming days/weeks/month/years I'll have lots more questions for you all, but right now just a quick simple one.

 

I'm using Ubuntu 13.04 (not sure if this makes a difference, although I'm sure you'll tell me if it does or not) I got the terminal open and muddling my way through the commands to navigate through directories (folders in windows speak lol) now much like the windows dos prompt and dos of long ago, I worked out you can change directories using "cd (insert name of directory)" but what I would like to know is how to I change back to the directory I was in previously. To illustrate what I mean, in a dos prompt I would type cd files-here and it will go to that directory then if I want to go to a sub directory I would while in the files-here directory type "cd more-files-here" but then if I want to return to the files-here directory I would simply type "cd.." to go back. I quickly realised this is not the case in a linux terminal. Could anyone tell me how I would navigate to that previous folder. Also if there are any good terminal tutorials I could be linked to to read up on what I'm doing I would be most greatful :)

 

Thanks in advance.

</div>
Ubuntu is a good distribution for a beginner. Easy to use with great GUI (Unity).

 

Here you have a site that explains some basic Linux command (under the Linux shell section):

 

http://linux-bible.com

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)