1

Im used to using nautilus within centos but have recently just got a VPS and quickly realising that using a KDE is unacceptable in this environment. Although I do find it so much quicker doing things like folder permissions in KDE rather than typing it all out in the terminal? Everyone I speak to says, use the terminal and I should learn this way as opposed to using the KDE, but theres certain things I just dont get

How is it possible to make quick changes to scripts and viewing them in a browser etc , without a mouse or using KDE? and only using a terminal?? I am wondering how to develop websites just using the terminal???

How can it be quicker to type out/view permissions etc in the terminal when its instant and just a few clicks in the KDE?

Any thoughts are much appreciated. I would love to understand the benefits but just cant seem to see them right now.

Cheers Ke.

2
  • 2
    Should be on superuser. Also not really a question (didn't say "not a question"). Commented Mar 18, 2010 at 23:50
  • A common way to develop sites for remote systems is that you set up a local server and development environment, develop everything locally, and then push the site in one big batch when things are working. Commented Jun 30, 2013 at 22:40

4 Answers 4

9

First of all, Nautilus is Gnome, not KDE. The browser for KDE is Konqueror or Dolphin. That said, the basic commands that you would need to know to be productive in the terminal are...

Navigating
Use cd folder to navigate to the specified folder. Use ls -l to show the contents of the current folder (including the permissions), and ls -l folder to list the contents and permissions of the given folder. Use ls -la and ls -la folder to do the same thing while including hidden files/folders.

Permissions
When you use ls with the "-l" flag, it will show you permissions that look like drwxrwxrwx, with each of those letters possibly replaced with a dash. The 'd' tells you whether it is a directory (so "-rwxrwxrwx" is a file while "drwxrwxrwx" is a folder). The first triple of "rwx" corresponds to the "user" (owner) of the item, the second corresponds to the "group", and the third corresponds to "others" (everyone else). You can use chmod to change the permissions of a given item. For example chmod a+x myscript.sh adds the "executable" permission to all users (user, group, others). The command chmod go-rwx supersecretfolder removes read, write, and executable permissions to the group and others for "supersecretfolder".

Creating/Removing
You can create files using the touch command, which will create an empty file if one doesn't exist, or it will update the modification date of the file, if it already exists. So, touch main.cpp will create a file named "main.cpp" in your current directory if it doesn't already exist.

You can remove files using the rm command, HOWEVER, this is an incredibly dangerous command, and so I will strongly urge you to instead use the mv command, which moves/renames files, and move them to the trash. I usually create a symbolic link from ~/.Trash to where the trash is actually located, and then I simply delete things using mv item_to_delete ~/.Trash/ which moves it to the trash.

Editing
There are plenty of editors that can run in the terminal. However, you should probably just use gedit which is not a terminal-based editor. You can open up your file in gedit with the following command:

gedit myfile >/dev/null 2>&1 & # I'm assuming BASH is your default shell

When I am absolutely required to edit something in the terminal, then I use nano, which you can invoke using the following, very simple command:

nano myfile

Other editors that you can use in the terminal include vim, vi, and emacs.

Copying
You can copy items using cp -rf original destination.

Symbolic Links
You can create symbolic links with ln -s original destination.

Opening a File in Firefox
You can open a file in firefox using firefox filename >/dev/null 2>&1 &

Opening Files with the Default Handler
I am not familiar with how to do this using KDE, but in Gnome, you can open a file using the default application that is configured to handle it by using the command gnome-open as in:

gnome-open myfile.cpp

If, in Gnome, you have registered the file extension ".cpp" with Anjuta C++, for example, then Anjuta C++ will be automatically opened and launched as if you had double-clicked on "myfile.cpp" in Nautilus.

Sources/References
For more information, you should take a look at the following man pages:

Pros/Cons
So, to answer your question... initially, it takes some time getting familiar with the terminal, and you will frequently have to consult the man pages to figure out how to do some things. However, as you become more experienced, you will find that it is significantly faster to do things in the terminal. I used to be very GUI-centric myself, but I now use the Terminal almost exclusively, because it is so much faster. Not only is it faster to type things (especially with BASH autocompletion) than it is to navigate with the mouse, but repeated tasks can often be automated, and you can use the BASH command history to reinvoke previous commands or slightly modified versions of previous commands. In the long run, making the switch is definitely worth it. That said, some things, like editing documents, does not make sense to do in the terminal... for example, I will probably always be more productive editing code with GEdit than I will be with vim or emacs, but launching GEdit from the Terminal instead of moving the mouse around is faster.

1
  • As mentioned it takes time and practice, but after a while you will be faster with a terminal. Spend some time reading the man pages for different commands, and use the terminal as often as you can. The only thing I would say to do different is really learn a terminal based editor, either vi/vim or emacs. Those will come in very handy if you ever have to ssh into a server and make some quick changes.
    – spowers
    Commented Mar 19, 2010 at 0:50
3

How is it possible to make quick changes to scripts and viewing them in a browser etc , without a mouse or using KDE? and only using a terminal?? I am wondering how to develop websites just using the terminal???

By using a screen mode Text Editor such as vim, emacs, pico or nano. As Michael suggested, the latter two are recommended for new students. You navigate text by using the Control key and command keys (emacs, pico, nano), or by switching from command mode to entry mode (vi, vim). Pico and Nano are nice in that they provide the most used keys as help on the terminal window at all times.

How can it be quicker to type out/view permissions etc in the terminal when its instant and just a few clicks in the KDE?

I can type faster than I can locate a mouse and click. For a slow typist, the opposite may be true. The command ls -l tells me almost everything about a file, and rolls off the fingers quickly. The alias ll, even faster. Learning to interpret the permission flag results takes a little time, but is intuitive in its own way.

Any thoughts are much appreciated. I would love to understand the benefits but just cant seem to see them right now.

Some people are visual thinkers, and don't readily adapt to the command line. Ultimately, the operating systems runs off of the shell, bash, which is what most users see when the bring up a terminal such as gnome-terminal or konsole. If you mostly do e-mail, surf the web and use Open Office, this may not matter to you. If you make a living programming or doing SysAdmin, it matters a great deal.

0

if you find unpractical to work from the terminal it is posible to work from your desktop using winscp for example, to edit documents directly on your vps.

winscp allows you to configure the editor you want ( eclipse, etc. )

2
  • winscp is an a file transfer client for Windows, so totally unrelated to the workflows one can pick under Linux. Commented Mar 19, 2010 at 0:40
  • Winscp provides a GUI interface to a non-local filesystem, including the ability to edit files. The original poster did not limit answers to the topic of workflows under Linux.
    – kmarsh
    Commented Mar 22, 2010 at 15:50
0

sshfs is another tool with which you can load the filesystem over the network into your local machine and then work on the files in your preferred local environment

2

You must log in to answer this question.