Announcement

Collapse
No announcement yet.

Some command line questions

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Some command line questions

    I'm teaching myself the command line and am stumped on a couple of things. I have two files on my desktop, Downloads and Save File. When I type cd Downloads it correctly says "jacatone@eMax:~/Desktop/Downloads$", but when I do the same for Save File it says "bash: cd: Save: No such file or directory". How come?

    If I use the command, mkdir to create a file, what command creates a text file? Then how do I add info to that text file?

    Thanks.

    #2
    Re: Some command line questions

    First, re the command line - perhaps you have read the LinuxCommand.org tutorial? I think in the tutorial there is a comment that recommends that file names of more than one word should have the spacer line included. Example - Save_File. Not - Save File.

    The txt file - In the menu of your text editor choose - File > Save As > (yourfilesname).txt

    Comment


      #3
      Re: Some command line questions

      Also, have a look at my how-to:

      Commands at Konsole: Beginners
      http://kubuntuforums.net/forums/inde...opic=3091607.0
      It gives an example of creating a text file.
      I'm not an expert; I only use the basics, as given in that tutorial.
      More importantly, see the Tuxfiles reference I give there, along with the ref weedy gave you.

      (please post questions again back here on the forum, as you have done this time)

      And my file
      works better if it is
      my_file
      or
      myfile
      or
      my-file
      or
      myFile
      or
      ...
      => one "word" or string, no spaces.
      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

      Comment


        #4
        Re: Some command line questions

        Save File

        Noticed that we didn't directly address your specific question:

        Save File would be written as Save\ File
        The backslash “escapes” the space between the words.
        Or, use quotes: 'Save File'

        btw, this is also at tuxfiles:

        http://www.tuxfiles.org/linuxhelp/weirdchars.html

        But, as I say, that's a good reason—and why most of us—escape using spaces, so we don't have to escape spaces
        Best to get in the habit of avoiding spaces.
        That backslash (the "escape character") is difficult to read, especially mixed in with other stuff in a complex command. Quotes are OK, but a nuisance, except in rare, exceptional cases.

        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          Re: Some command line questions

          Originally posted by jacatone
          When I type cd Downloads it correctly says "jacatone@eMax:~/Desktop/Downloads$", but when I do the same for Save File it says "bash: cd: Save: No such file or directory". How come?
          you created 2 dirs.. Save and File. the reason is the space. if you wanna create a dir with a space in the middle:

          mkdir " Save File"

          but note that" cd Safe File" give you no such file or dir. To solve ... you have to write

          cd Save\ File
          or
          cd "save file"

          hint: DONT USE SPACES ... use "Save_File" its much easier ( and readable)

          Originally posted by jacatone
          If I use the command, mkdir to create a file, what command creates a text file? Then how do I add info to that text file?
          to create an empy file use "touch"
          example:
          touch test.txt

          but is you want to write in the easier way is to use an editor ( for example vi ):

          example:
          vi test.txt

          keep in mind that vi is quite complicated to use... its better you google some howto's else you'll get crazy.


          Comment

          Working...
          X