How do I enter a file or directory with special characters in its name?How to write the path of a folder with...

Why do members of Congress in committee hearings ask witnesses the same question multiple times?

How to remove lines while keeping individual rows visible on a tablet

What to do when being responsible for data protection in your lab, yet advice is ignored?

Why is this code uniquely decodable?

What am I? I am in theaters and computer programs

Is there any relevance to Thor getting his hair cut other than comedic value?

Six real numbers so that product of any five is the sixth one

Is divide-by-zero a security vulnerability?

How to properly claim credit for peer review?

Does music exist in Panem? And if so, what kinds of music?

Are small insurances worth it

Has the Isbell–Freyd criterion ever been used to check that a category is concretisable?

Sometimes a banana is just a banana

Eww, those bytes are gross

Gnome Lock Screen Terminology

What do the pedals on grand pianos do?

Do commercial flights continue with an engine out?

Should I choose Itemized or Standard deduction?

Returning to Programming after 6 years. A little lost on how to start brushing up, what to focus on

How to avoid being sexist when trying to employ someone to function in a very sexist environment?

g++ and clang++ different behaviour with recursive initialization of a static member

How can I mix up weapons for large groups of similar monsters/characters?

How to visualize a Cayley graph in this style?

If I am a new writer, where can I take help from a professional to judge my work?



How do I enter a file or directory with special characters in its name?


How to write the path of a folder with space in its name?How do I navigate to folders with spaces in their names? I get “no such file or directory” when I tryUsing cd command to navigate directories in Ubuntu which have special charactersHow can I protect parentheses passed to a cd command?How to access files/directories with spaces in the name?How can I enter and also rename folders like ''Human (2012)''?using '&' in a directory nameDealing with space in file links using bashcd to a directory has hash (#)unzip unable to find file with spaces in file nameCan you help me to understand this explanation of shell quoting?Resize multiple files and rename them properlyRun multiple line as a single line command bashProblem with spaces in file namesProblem with input from simple script that copies a file to a different directoryInstall vegan package for R via terminal commandfinding a word in a stringGiving cat output to rmHow do I enter a file or directory name containing spaces or special characters in the terminal?Cannot delete/move files with special characters in file name













39















I want to enter the following folder in the terminal:



Milano, Torino (Jan)-Compressed


How should I write the command cd to enter this directory?



Spaces and several other special characters like , *, ), ( and ? cause problems when I try to use them in the command line or scripts, e.g.:





$ cd space dir
bash: cd: space: No such file or directory

$ cat space file
cat: space: No such file or directory
cat: file: No such file or directory

$ cat (
bash: syntax error near unexpected token `newline'

$ echo content >
> ^C

$ ls ?
( ) * ?


How do I enter file or directory names that contain special characters in the terminal in general?










share|improve this question





























    39















    I want to enter the following folder in the terminal:



    Milano, Torino (Jan)-Compressed


    How should I write the command cd to enter this directory?



    Spaces and several other special characters like , *, ), ( and ? cause problems when I try to use them in the command line or scripts, e.g.:





    $ cd space dir
    bash: cd: space: No such file or directory

    $ cat space file
    cat: space: No such file or directory
    cat: file: No such file or directory

    $ cat (
    bash: syntax error near unexpected token `newline'

    $ echo content >
    > ^C

    $ ls ?
    ( ) * ?


    How do I enter file or directory names that contain special characters in the terminal in general?










    share|improve this question



























      39












      39








      39


      8






      I want to enter the following folder in the terminal:



      Milano, Torino (Jan)-Compressed


      How should I write the command cd to enter this directory?



      Spaces and several other special characters like , *, ), ( and ? cause problems when I try to use them in the command line or scripts, e.g.:





      $ cd space dir
      bash: cd: space: No such file or directory

      $ cat space file
      cat: space: No such file or directory
      cat: file: No such file or directory

      $ cat (
      bash: syntax error near unexpected token `newline'

      $ echo content >
      > ^C

      $ ls ?
      ( ) * ?


      How do I enter file or directory names that contain special characters in the terminal in general?










      share|improve this question
















      I want to enter the following folder in the terminal:



      Milano, Torino (Jan)-Compressed


      How should I write the command cd to enter this directory?



      Spaces and several other special characters like , *, ), ( and ? cause problems when I try to use them in the command line or scripts, e.g.:





      $ cd space dir
      bash: cd: space: No such file or directory

      $ cat space file
      cat: space: No such file or directory
      cat: file: No such file or directory

      $ cat (
      bash: syntax error near unexpected token `newline'

      $ echo content >
      > ^C

      $ ls ?
      ( ) * ?


      How do I enter file or directory names that contain special characters in the terminal in general?







      command-line filename cd-command






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 13 '18 at 15:08









      dessert

      24.2k670104




      24.2k670104










      asked Feb 5 '12 at 11:58









      PomarioPomario

      93861328




      93861328






















          8 Answers
          8






          active

          oldest

          votes


















          41














          That command is ambiguous because spaces are normally used to separate arguments. cd does not know what you want to do but you have two possibilities to solve it:



          Either you "mask" the spaces (and all other special characters) so that the terminal knows you mean the space as a character and not as a separator:



          cd Milano, Torino (Jan)-Compressed


          Or you put your folder name or path into quotes:



          cd "Milano, Torino (Jan)-Compressed"





          share|improve this answer































            26














            A little tip: tab completion ;-)




            1. Just type the first letter e.g cd Mi (or more letters if needed) and press Tab. Terminal will help you by completing the rest words.


            Another way: drag and drop




            1. If you can see the directory and if you want to access it using terminal, just type: cd first and then drag and drop the directory on the terminal and hit enter.






            share|improve this answer

































              24














              Write it as:



              cd 'Milano, Torino (Jan)-Compressed'


              Otherwise it treats Milano, as the folder name. This happens because of the spaces in the name of the folder. Alternatively escape a few of the special characters:



              cd Milano, Torino (Jan)-Compressed/





              share|improve this answer

































                22














                tl;dr: To quote a special character either escape it with a backslash or enclose it in double " " or single quotes ' '. Tab ↹ Completion takes care of proper quoting.





                What you're asking for is called Quoting:




                Quoting is used to remove the special meaning of certain characters or words to the shell. (…) There are three quoting mechanisms: the escape character, single quotes, and double quotes.
                [citations taken from man bash]




                Quoting with the escape character




                A non-quoted backslash () is the escape character. It preserves the literal value of the next character that follows, with the exception of <newline>.




                So to enter a directory or a file with a special character, escape the latter with , e.g.:



                cd space dir      # change into directory called “space dir”
                cat space file # print the content of file “space file”
                echo content > \ # print “content” into file “”
                cat ( # print the content of file “(”
                ls -l ? # list file “?”


                bash's Programmable Completion (aka Tab ↹ Completion) automatically escapes special characters with the escape character .



                Quoting with double quotes " "




                Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of $, `, , and, when history expansion is enabled, !.




                So to enter a directory or a file with a special character, escape at least the latter or a greater part of your filename or path with double quotes, e.g.:



                cd space" "dir     # change into directory called “space dir”
                cd spac"e di"r # equally
                cd "space dir" # equally
                cat "space file" # print the content of file “space file”
                cat "(" # print the content of file “(”
                ls -l "?" # list file “?”


                As $, ` and ! keep their special meaning inside double quotes, Parameter Expansion, Command Substitution, Arithmetic Expansion and History Expansion are performed on double-quoted strings.



                Quoting with single quotes ' '




                Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.




                So to enter a directory or a file with a special character, escape at least the latter or a greater part of your filename or path with double quotes, e.g.:



                cd space' 'dir     # change into directory called “space dir”
                cd spac'e di'r # equal
                cd 'space dir' # equal
                cat 'space file' # print the content of file “space file”
                cat '(' # print the content of file “(”
                ls -l '?' # list file “?”
                echo content > '' # print “content” into file “”




                You can find more about Quoting in man bash/QUOTING, on wiki.bash-hackers.org and on tldp.org.






                share|improve this answer

































                  10














                  C-like strings and $'string'



                  Among other things, one can use $'...' type of quoting to make use of ANSI-C backslash characters such as n and t, including those you've mentioned. From bash 4.3 manual:




                  Words of the form $'string' are treated specially. The word expands
                  to string, with backslash-escaped characters replaced as specified
                  by the ANSI C standard.




                  This is particularly useful with files which contain newlines, tabs, when you're writing complex awk lines where you need to make use of different ways to distinguish between single and double quotes, when filenames themselves contain single/double quote mishmash,etc.



                  For example, creating and listing such files:



                  $ touch a$'*'b  c$'n'd                                                     
                  $ ls a$'*'b c$'n'd
                  a*b c?d


                  You can make use of character hex values, such as:



                  $ touch 'file(name'
                  $ ls file$'x28'name
                  file(name


                  printf



                  Same idea as before - take advantage of escape characters:



                  $ ls "$(printf "filex28name")"                                             
                  file(name
                  $ echo "Hello World" > c$'n'd
                  $ cat "$(printf "cnd")"
                  Hello World


                  Use inodes:



                  Every file or directory has special data structure associated with it called inode, which are referenced by a particular decimal number. So you can use that to indirectly locate the file with particular inode via find command, and do something with it:



                  $ echo "This is a test" > file$'('name1
                  $ ls -i
                  5898996 file(name1 5898997 file?name2
                  $ find -type f -inum "5898996" -exec cat {} ;
                  This is a test


                  Avoid dealing with individual files when you can use glob



                  When you don't have to deal with individual files, just take advantage of * glob character in shell and quote variables when passing them to other commands. It makes dealing with difficult filenames much easier:



                  $ for f in ./*; do echo "$f" ; done
                  file name2
                  file(name1


                  Note the use of ./ - a safeguard against filenames which may contain leading - in them.






                  share|improve this answer

































                    6














                    To open a folder containing a space surround it in quotes like cd "Some Directory" or escape the space with a backslash, like: cd /home/kudic/Radna površina.






                    share|improve this answer





















                    • 3





                      Or escape the space with a backslash, like: cd /home/kudic/Radna površina

                      – Timo
                      Jul 10 '12 at 13:43











                    • Great point! I forgot to mention that. I normally use quotes out of habit, but the backslash is actually better to use in the long run.

                      – Corey Whitaker
                      Jul 10 '12 at 13:45






                    • 1





                      Or use single quotes ('Radna površina'), if you don't want environment variables ($VARNAME) to be expanded and commands enclosed in backticks or $() to be run (or if there are double-quotes in the filename).

                      – Eliah Kagan
                      Jul 10 '12 at 13:49





















                    3














                    If this directory is in your home folder then type:



                    cd "Milano, Torino (Jan)-Compressed"


                    else give absolute path:



                    cd "/…/…/Milano, Torino (Jan)-Compressed"


                    if there is a double quote in file name then escape that with "






                    share|improve this answer


























                    • If you start a path with a leading forward slash, it goes from root. You might want to remove that.

                      – isaaclw
                      Feb 5 '12 at 21:52











                    • @isaaclw That is why he filed it as an absolute path :P

                      – user13091
                      Feb 6 '12 at 1:16






                    • 1





                      Ah, that's three dots, indicating a "variable" folder. I assumed it was two dots, indicating "parent folder". Apologies.

                      – isaaclw
                      Feb 6 '12 at 3:43



















                    3














                    Another option although not the best in this case is to use wildcards. You can try:



                    cd *Torino*



                    It is best to use this method when there is a distinct word or phrase in the name of a directory not shared by others. For example I have mount points /media/DataSSD and /media/DataHDD. Autocompletion doesn't work until I type nearly half of the name so to get to my HDD partition I just type



                    cd /media/*HD*






                    share|improve this answer























                      Your Answer








                      StackExchange.ready(function() {
                      var channelOptions = {
                      tags: "".split(" "),
                      id: "89"
                      };
                      initTagRenderer("".split(" "), "".split(" "), channelOptions);

                      StackExchange.using("externalEditor", function() {
                      // Have to fire editor after snippets, if snippets enabled
                      if (StackExchange.settings.snippets.snippetsEnabled) {
                      StackExchange.using("snippets", function() {
                      createEditor();
                      });
                      }
                      else {
                      createEditor();
                      }
                      });

                      function createEditor() {
                      StackExchange.prepareEditor({
                      heartbeatType: 'answer',
                      autoActivateHeartbeat: false,
                      convertImagesToLinks: true,
                      noModals: true,
                      showLowRepImageUploadWarning: true,
                      reputationToPostImages: 10,
                      bindNavPrevention: true,
                      postfix: "",
                      imageUploader: {
                      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                      allowUrls: true
                      },
                      onDemand: true,
                      discardSelector: ".discard-answer"
                      ,immediatelyShowMarkdownHelp:true
                      });


                      }
                      });














                      draft saved

                      draft discarded


















                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f101587%2fhow-do-i-enter-a-file-or-directory-with-special-characters-in-its-name%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown

























                      8 Answers
                      8






                      active

                      oldest

                      votes








                      8 Answers
                      8






                      active

                      oldest

                      votes









                      active

                      oldest

                      votes






                      active

                      oldest

                      votes









                      41














                      That command is ambiguous because spaces are normally used to separate arguments. cd does not know what you want to do but you have two possibilities to solve it:



                      Either you "mask" the spaces (and all other special characters) so that the terminal knows you mean the space as a character and not as a separator:



                      cd Milano, Torino (Jan)-Compressed


                      Or you put your folder name or path into quotes:



                      cd "Milano, Torino (Jan)-Compressed"





                      share|improve this answer




























                        41














                        That command is ambiguous because spaces are normally used to separate arguments. cd does not know what you want to do but you have two possibilities to solve it:



                        Either you "mask" the spaces (and all other special characters) so that the terminal knows you mean the space as a character and not as a separator:



                        cd Milano, Torino (Jan)-Compressed


                        Or you put your folder name or path into quotes:



                        cd "Milano, Torino (Jan)-Compressed"





                        share|improve this answer


























                          41












                          41








                          41







                          That command is ambiguous because spaces are normally used to separate arguments. cd does not know what you want to do but you have two possibilities to solve it:



                          Either you "mask" the spaces (and all other special characters) so that the terminal knows you mean the space as a character and not as a separator:



                          cd Milano, Torino (Jan)-Compressed


                          Or you put your folder name or path into quotes:



                          cd "Milano, Torino (Jan)-Compressed"





                          share|improve this answer













                          That command is ambiguous because spaces are normally used to separate arguments. cd does not know what you want to do but you have two possibilities to solve it:



                          Either you "mask" the spaces (and all other special characters) so that the terminal knows you mean the space as a character and not as a separator:



                          cd Milano, Torino (Jan)-Compressed


                          Or you put your folder name or path into quotes:



                          cd "Milano, Torino (Jan)-Compressed"






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Feb 5 '12 at 12:05









                          krystophkrystoph

                          43643




                          43643

























                              26














                              A little tip: tab completion ;-)




                              1. Just type the first letter e.g cd Mi (or more letters if needed) and press Tab. Terminal will help you by completing the rest words.


                              Another way: drag and drop




                              1. If you can see the directory and if you want to access it using terminal, just type: cd first and then drag and drop the directory on the terminal and hit enter.






                              share|improve this answer






























                                26














                                A little tip: tab completion ;-)




                                1. Just type the first letter e.g cd Mi (or more letters if needed) and press Tab. Terminal will help you by completing the rest words.


                                Another way: drag and drop




                                1. If you can see the directory and if you want to access it using terminal, just type: cd first and then drag and drop the directory on the terminal and hit enter.






                                share|improve this answer




























                                  26












                                  26








                                  26







                                  A little tip: tab completion ;-)




                                  1. Just type the first letter e.g cd Mi (or more letters if needed) and press Tab. Terminal will help you by completing the rest words.


                                  Another way: drag and drop




                                  1. If you can see the directory and if you want to access it using terminal, just type: cd first and then drag and drop the directory on the terminal and hit enter.






                                  share|improve this answer















                                  A little tip: tab completion ;-)




                                  1. Just type the first letter e.g cd Mi (or more letters if needed) and press Tab. Terminal will help you by completing the rest words.


                                  Another way: drag and drop




                                  1. If you can see the directory and if you want to access it using terminal, just type: cd first and then drag and drop the directory on the terminal and hit enter.







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Jan 2 at 5:37

























                                  answered Feb 5 '12 at 12:35









                                  AchuAchu

                                  16k136499




                                  16k136499























                                      24














                                      Write it as:



                                      cd 'Milano, Torino (Jan)-Compressed'


                                      Otherwise it treats Milano, as the folder name. This happens because of the spaces in the name of the folder. Alternatively escape a few of the special characters:



                                      cd Milano, Torino (Jan)-Compressed/





                                      share|improve this answer






























                                        24














                                        Write it as:



                                        cd 'Milano, Torino (Jan)-Compressed'


                                        Otherwise it treats Milano, as the folder name. This happens because of the spaces in the name of the folder. Alternatively escape a few of the special characters:



                                        cd Milano, Torino (Jan)-Compressed/





                                        share|improve this answer




























                                          24












                                          24








                                          24







                                          Write it as:



                                          cd 'Milano, Torino (Jan)-Compressed'


                                          Otherwise it treats Milano, as the folder name. This happens because of the spaces in the name of the folder. Alternatively escape a few of the special characters:



                                          cd Milano, Torino (Jan)-Compressed/





                                          share|improve this answer















                                          Write it as:



                                          cd 'Milano, Torino (Jan)-Compressed'


                                          Otherwise it treats Milano, as the folder name. This happens because of the spaces in the name of the folder. Alternatively escape a few of the special characters:



                                          cd Milano, Torino (Jan)-Compressed/






                                          share|improve this answer














                                          share|improve this answer



                                          share|improve this answer








                                          edited Feb 13 at 22:58









                                          dessert

                                          24.2k670104




                                          24.2k670104










                                          answered Feb 5 '12 at 11:59









                                          PrateekPrateek

                                          2,07621731




                                          2,07621731























                                              22














                                              tl;dr: To quote a special character either escape it with a backslash or enclose it in double " " or single quotes ' '. Tab ↹ Completion takes care of proper quoting.





                                              What you're asking for is called Quoting:




                                              Quoting is used to remove the special meaning of certain characters or words to the shell. (…) There are three quoting mechanisms: the escape character, single quotes, and double quotes.
                                              [citations taken from man bash]




                                              Quoting with the escape character




                                              A non-quoted backslash () is the escape character. It preserves the literal value of the next character that follows, with the exception of <newline>.




                                              So to enter a directory or a file with a special character, escape the latter with , e.g.:



                                              cd space dir      # change into directory called “space dir”
                                              cat space file # print the content of file “space file”
                                              echo content > \ # print “content” into file “”
                                              cat ( # print the content of file “(”
                                              ls -l ? # list file “?”


                                              bash's Programmable Completion (aka Tab ↹ Completion) automatically escapes special characters with the escape character .



                                              Quoting with double quotes " "




                                              Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of $, `, , and, when history expansion is enabled, !.




                                              So to enter a directory or a file with a special character, escape at least the latter or a greater part of your filename or path with double quotes, e.g.:



                                              cd space" "dir     # change into directory called “space dir”
                                              cd spac"e di"r # equally
                                              cd "space dir" # equally
                                              cat "space file" # print the content of file “space file”
                                              cat "(" # print the content of file “(”
                                              ls -l "?" # list file “?”


                                              As $, ` and ! keep their special meaning inside double quotes, Parameter Expansion, Command Substitution, Arithmetic Expansion and History Expansion are performed on double-quoted strings.



                                              Quoting with single quotes ' '




                                              Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.




                                              So to enter a directory or a file with a special character, escape at least the latter or a greater part of your filename or path with double quotes, e.g.:



                                              cd space' 'dir     # change into directory called “space dir”
                                              cd spac'e di'r # equal
                                              cd 'space dir' # equal
                                              cat 'space file' # print the content of file “space file”
                                              cat '(' # print the content of file “(”
                                              ls -l '?' # list file “?”
                                              echo content > '' # print “content” into file “”




                                              You can find more about Quoting in man bash/QUOTING, on wiki.bash-hackers.org and on tldp.org.






                                              share|improve this answer






























                                                22














                                                tl;dr: To quote a special character either escape it with a backslash or enclose it in double " " or single quotes ' '. Tab ↹ Completion takes care of proper quoting.





                                                What you're asking for is called Quoting:




                                                Quoting is used to remove the special meaning of certain characters or words to the shell. (…) There are three quoting mechanisms: the escape character, single quotes, and double quotes.
                                                [citations taken from man bash]




                                                Quoting with the escape character




                                                A non-quoted backslash () is the escape character. It preserves the literal value of the next character that follows, with the exception of <newline>.




                                                So to enter a directory or a file with a special character, escape the latter with , e.g.:



                                                cd space dir      # change into directory called “space dir”
                                                cat space file # print the content of file “space file”
                                                echo content > \ # print “content” into file “”
                                                cat ( # print the content of file “(”
                                                ls -l ? # list file “?”


                                                bash's Programmable Completion (aka Tab ↹ Completion) automatically escapes special characters with the escape character .



                                                Quoting with double quotes " "




                                                Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of $, `, , and, when history expansion is enabled, !.




                                                So to enter a directory or a file with a special character, escape at least the latter or a greater part of your filename or path with double quotes, e.g.:



                                                cd space" "dir     # change into directory called “space dir”
                                                cd spac"e di"r # equally
                                                cd "space dir" # equally
                                                cat "space file" # print the content of file “space file”
                                                cat "(" # print the content of file “(”
                                                ls -l "?" # list file “?”


                                                As $, ` and ! keep their special meaning inside double quotes, Parameter Expansion, Command Substitution, Arithmetic Expansion and History Expansion are performed on double-quoted strings.



                                                Quoting with single quotes ' '




                                                Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.




                                                So to enter a directory or a file with a special character, escape at least the latter or a greater part of your filename or path with double quotes, e.g.:



                                                cd space' 'dir     # change into directory called “space dir”
                                                cd spac'e di'r # equal
                                                cd 'space dir' # equal
                                                cat 'space file' # print the content of file “space file”
                                                cat '(' # print the content of file “(”
                                                ls -l '?' # list file “?”
                                                echo content > '' # print “content” into file “”




                                                You can find more about Quoting in man bash/QUOTING, on wiki.bash-hackers.org and on tldp.org.






                                                share|improve this answer




























                                                  22












                                                  22








                                                  22







                                                  tl;dr: To quote a special character either escape it with a backslash or enclose it in double " " or single quotes ' '. Tab ↹ Completion takes care of proper quoting.





                                                  What you're asking for is called Quoting:




                                                  Quoting is used to remove the special meaning of certain characters or words to the shell. (…) There are three quoting mechanisms: the escape character, single quotes, and double quotes.
                                                  [citations taken from man bash]




                                                  Quoting with the escape character




                                                  A non-quoted backslash () is the escape character. It preserves the literal value of the next character that follows, with the exception of <newline>.




                                                  So to enter a directory or a file with a special character, escape the latter with , e.g.:



                                                  cd space dir      # change into directory called “space dir”
                                                  cat space file # print the content of file “space file”
                                                  echo content > \ # print “content” into file “”
                                                  cat ( # print the content of file “(”
                                                  ls -l ? # list file “?”


                                                  bash's Programmable Completion (aka Tab ↹ Completion) automatically escapes special characters with the escape character .



                                                  Quoting with double quotes " "




                                                  Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of $, `, , and, when history expansion is enabled, !.




                                                  So to enter a directory or a file with a special character, escape at least the latter or a greater part of your filename or path with double quotes, e.g.:



                                                  cd space" "dir     # change into directory called “space dir”
                                                  cd spac"e di"r # equally
                                                  cd "space dir" # equally
                                                  cat "space file" # print the content of file “space file”
                                                  cat "(" # print the content of file “(”
                                                  ls -l "?" # list file “?”


                                                  As $, ` and ! keep their special meaning inside double quotes, Parameter Expansion, Command Substitution, Arithmetic Expansion and History Expansion are performed on double-quoted strings.



                                                  Quoting with single quotes ' '




                                                  Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.




                                                  So to enter a directory or a file with a special character, escape at least the latter or a greater part of your filename or path with double quotes, e.g.:



                                                  cd space' 'dir     # change into directory called “space dir”
                                                  cd spac'e di'r # equal
                                                  cd 'space dir' # equal
                                                  cat 'space file' # print the content of file “space file”
                                                  cat '(' # print the content of file “(”
                                                  ls -l '?' # list file “?”
                                                  echo content > '' # print “content” into file “”




                                                  You can find more about Quoting in man bash/QUOTING, on wiki.bash-hackers.org and on tldp.org.






                                                  share|improve this answer















                                                  tl;dr: To quote a special character either escape it with a backslash or enclose it in double " " or single quotes ' '. Tab ↹ Completion takes care of proper quoting.





                                                  What you're asking for is called Quoting:




                                                  Quoting is used to remove the special meaning of certain characters or words to the shell. (…) There are three quoting mechanisms: the escape character, single quotes, and double quotes.
                                                  [citations taken from man bash]




                                                  Quoting with the escape character




                                                  A non-quoted backslash () is the escape character. It preserves the literal value of the next character that follows, with the exception of <newline>.




                                                  So to enter a directory or a file with a special character, escape the latter with , e.g.:



                                                  cd space dir      # change into directory called “space dir”
                                                  cat space file # print the content of file “space file”
                                                  echo content > \ # print “content” into file “”
                                                  cat ( # print the content of file “(”
                                                  ls -l ? # list file “?”


                                                  bash's Programmable Completion (aka Tab ↹ Completion) automatically escapes special characters with the escape character .



                                                  Quoting with double quotes " "




                                                  Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of $, `, , and, when history expansion is enabled, !.




                                                  So to enter a directory or a file with a special character, escape at least the latter or a greater part of your filename or path with double quotes, e.g.:



                                                  cd space" "dir     # change into directory called “space dir”
                                                  cd spac"e di"r # equally
                                                  cd "space dir" # equally
                                                  cat "space file" # print the content of file “space file”
                                                  cat "(" # print the content of file “(”
                                                  ls -l "?" # list file “?”


                                                  As $, ` and ! keep their special meaning inside double quotes, Parameter Expansion, Command Substitution, Arithmetic Expansion and History Expansion are performed on double-quoted strings.



                                                  Quoting with single quotes ' '




                                                  Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.




                                                  So to enter a directory or a file with a special character, escape at least the latter or a greater part of your filename or path with double quotes, e.g.:



                                                  cd space' 'dir     # change into directory called “space dir”
                                                  cd spac'e di'r # equal
                                                  cd 'space dir' # equal
                                                  cat 'space file' # print the content of file “space file”
                                                  cat '(' # print the content of file “(”
                                                  ls -l '?' # list file “?”
                                                  echo content > '' # print “content” into file “”




                                                  You can find more about Quoting in man bash/QUOTING, on wiki.bash-hackers.org and on tldp.org.







                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited Dec 30 '17 at 20:40

























                                                  answered Dec 9 '17 at 21:31









                                                  dessertdessert

                                                  24.2k670104




                                                  24.2k670104























                                                      10














                                                      C-like strings and $'string'



                                                      Among other things, one can use $'...' type of quoting to make use of ANSI-C backslash characters such as n and t, including those you've mentioned. From bash 4.3 manual:




                                                      Words of the form $'string' are treated specially. The word expands
                                                      to string, with backslash-escaped characters replaced as specified
                                                      by the ANSI C standard.




                                                      This is particularly useful with files which contain newlines, tabs, when you're writing complex awk lines where you need to make use of different ways to distinguish between single and double quotes, when filenames themselves contain single/double quote mishmash,etc.



                                                      For example, creating and listing such files:



                                                      $ touch a$'*'b  c$'n'd                                                     
                                                      $ ls a$'*'b c$'n'd
                                                      a*b c?d


                                                      You can make use of character hex values, such as:



                                                      $ touch 'file(name'
                                                      $ ls file$'x28'name
                                                      file(name


                                                      printf



                                                      Same idea as before - take advantage of escape characters:



                                                      $ ls "$(printf "filex28name")"                                             
                                                      file(name
                                                      $ echo "Hello World" > c$'n'd
                                                      $ cat "$(printf "cnd")"
                                                      Hello World


                                                      Use inodes:



                                                      Every file or directory has special data structure associated with it called inode, which are referenced by a particular decimal number. So you can use that to indirectly locate the file with particular inode via find command, and do something with it:



                                                      $ echo "This is a test" > file$'('name1
                                                      $ ls -i
                                                      5898996 file(name1 5898997 file?name2
                                                      $ find -type f -inum "5898996" -exec cat {} ;
                                                      This is a test


                                                      Avoid dealing with individual files when you can use glob



                                                      When you don't have to deal with individual files, just take advantage of * glob character in shell and quote variables when passing them to other commands. It makes dealing with difficult filenames much easier:



                                                      $ for f in ./*; do echo "$f" ; done
                                                      file name2
                                                      file(name1


                                                      Note the use of ./ - a safeguard against filenames which may contain leading - in them.






                                                      share|improve this answer






























                                                        10














                                                        C-like strings and $'string'



                                                        Among other things, one can use $'...' type of quoting to make use of ANSI-C backslash characters such as n and t, including those you've mentioned. From bash 4.3 manual:




                                                        Words of the form $'string' are treated specially. The word expands
                                                        to string, with backslash-escaped characters replaced as specified
                                                        by the ANSI C standard.




                                                        This is particularly useful with files which contain newlines, tabs, when you're writing complex awk lines where you need to make use of different ways to distinguish between single and double quotes, when filenames themselves contain single/double quote mishmash,etc.



                                                        For example, creating and listing such files:



                                                        $ touch a$'*'b  c$'n'd                                                     
                                                        $ ls a$'*'b c$'n'd
                                                        a*b c?d


                                                        You can make use of character hex values, such as:



                                                        $ touch 'file(name'
                                                        $ ls file$'x28'name
                                                        file(name


                                                        printf



                                                        Same idea as before - take advantage of escape characters:



                                                        $ ls "$(printf "filex28name")"                                             
                                                        file(name
                                                        $ echo "Hello World" > c$'n'd
                                                        $ cat "$(printf "cnd")"
                                                        Hello World


                                                        Use inodes:



                                                        Every file or directory has special data structure associated with it called inode, which are referenced by a particular decimal number. So you can use that to indirectly locate the file with particular inode via find command, and do something with it:



                                                        $ echo "This is a test" > file$'('name1
                                                        $ ls -i
                                                        5898996 file(name1 5898997 file?name2
                                                        $ find -type f -inum "5898996" -exec cat {} ;
                                                        This is a test


                                                        Avoid dealing with individual files when you can use glob



                                                        When you don't have to deal with individual files, just take advantage of * glob character in shell and quote variables when passing them to other commands. It makes dealing with difficult filenames much easier:



                                                        $ for f in ./*; do echo "$f" ; done
                                                        file name2
                                                        file(name1


                                                        Note the use of ./ - a safeguard against filenames which may contain leading - in them.






                                                        share|improve this answer




























                                                          10












                                                          10








                                                          10







                                                          C-like strings and $'string'



                                                          Among other things, one can use $'...' type of quoting to make use of ANSI-C backslash characters such as n and t, including those you've mentioned. From bash 4.3 manual:




                                                          Words of the form $'string' are treated specially. The word expands
                                                          to string, with backslash-escaped characters replaced as specified
                                                          by the ANSI C standard.




                                                          This is particularly useful with files which contain newlines, tabs, when you're writing complex awk lines where you need to make use of different ways to distinguish between single and double quotes, when filenames themselves contain single/double quote mishmash,etc.



                                                          For example, creating and listing such files:



                                                          $ touch a$'*'b  c$'n'd                                                     
                                                          $ ls a$'*'b c$'n'd
                                                          a*b c?d


                                                          You can make use of character hex values, such as:



                                                          $ touch 'file(name'
                                                          $ ls file$'x28'name
                                                          file(name


                                                          printf



                                                          Same idea as before - take advantage of escape characters:



                                                          $ ls "$(printf "filex28name")"                                             
                                                          file(name
                                                          $ echo "Hello World" > c$'n'd
                                                          $ cat "$(printf "cnd")"
                                                          Hello World


                                                          Use inodes:



                                                          Every file or directory has special data structure associated with it called inode, which are referenced by a particular decimal number. So you can use that to indirectly locate the file with particular inode via find command, and do something with it:



                                                          $ echo "This is a test" > file$'('name1
                                                          $ ls -i
                                                          5898996 file(name1 5898997 file?name2
                                                          $ find -type f -inum "5898996" -exec cat {} ;
                                                          This is a test


                                                          Avoid dealing with individual files when you can use glob



                                                          When you don't have to deal with individual files, just take advantage of * glob character in shell and quote variables when passing them to other commands. It makes dealing with difficult filenames much easier:



                                                          $ for f in ./*; do echo "$f" ; done
                                                          file name2
                                                          file(name1


                                                          Note the use of ./ - a safeguard against filenames which may contain leading - in them.






                                                          share|improve this answer















                                                          C-like strings and $'string'



                                                          Among other things, one can use $'...' type of quoting to make use of ANSI-C backslash characters such as n and t, including those you've mentioned. From bash 4.3 manual:




                                                          Words of the form $'string' are treated specially. The word expands
                                                          to string, with backslash-escaped characters replaced as specified
                                                          by the ANSI C standard.




                                                          This is particularly useful with files which contain newlines, tabs, when you're writing complex awk lines where you need to make use of different ways to distinguish between single and double quotes, when filenames themselves contain single/double quote mishmash,etc.



                                                          For example, creating and listing such files:



                                                          $ touch a$'*'b  c$'n'd                                                     
                                                          $ ls a$'*'b c$'n'd
                                                          a*b c?d


                                                          You can make use of character hex values, such as:



                                                          $ touch 'file(name'
                                                          $ ls file$'x28'name
                                                          file(name


                                                          printf



                                                          Same idea as before - take advantage of escape characters:



                                                          $ ls "$(printf "filex28name")"                                             
                                                          file(name
                                                          $ echo "Hello World" > c$'n'd
                                                          $ cat "$(printf "cnd")"
                                                          Hello World


                                                          Use inodes:



                                                          Every file or directory has special data structure associated with it called inode, which are referenced by a particular decimal number. So you can use that to indirectly locate the file with particular inode via find command, and do something with it:



                                                          $ echo "This is a test" > file$'('name1
                                                          $ ls -i
                                                          5898996 file(name1 5898997 file?name2
                                                          $ find -type f -inum "5898996" -exec cat {} ;
                                                          This is a test


                                                          Avoid dealing with individual files when you can use glob



                                                          When you don't have to deal with individual files, just take advantage of * glob character in shell and quote variables when passing them to other commands. It makes dealing with difficult filenames much easier:



                                                          $ for f in ./*; do echo "$f" ; done
                                                          file name2
                                                          file(name1


                                                          Note the use of ./ - a safeguard against filenames which may contain leading - in them.







                                                          share|improve this answer














                                                          share|improve this answer



                                                          share|improve this answer








                                                          edited Dec 9 '17 at 22:04

























                                                          answered Dec 9 '17 at 21:43









                                                          Sergiy KolodyazhnyySergiy Kolodyazhnyy

                                                          73.5k9153318




                                                          73.5k9153318























                                                              6














                                                              To open a folder containing a space surround it in quotes like cd "Some Directory" or escape the space with a backslash, like: cd /home/kudic/Radna površina.






                                                              share|improve this answer





















                                                              • 3





                                                                Or escape the space with a backslash, like: cd /home/kudic/Radna površina

                                                                – Timo
                                                                Jul 10 '12 at 13:43











                                                              • Great point! I forgot to mention that. I normally use quotes out of habit, but the backslash is actually better to use in the long run.

                                                                – Corey Whitaker
                                                                Jul 10 '12 at 13:45






                                                              • 1





                                                                Or use single quotes ('Radna površina'), if you don't want environment variables ($VARNAME) to be expanded and commands enclosed in backticks or $() to be run (or if there are double-quotes in the filename).

                                                                – Eliah Kagan
                                                                Jul 10 '12 at 13:49


















                                                              6














                                                              To open a folder containing a space surround it in quotes like cd "Some Directory" or escape the space with a backslash, like: cd /home/kudic/Radna površina.






                                                              share|improve this answer





















                                                              • 3





                                                                Or escape the space with a backslash, like: cd /home/kudic/Radna površina

                                                                – Timo
                                                                Jul 10 '12 at 13:43











                                                              • Great point! I forgot to mention that. I normally use quotes out of habit, but the backslash is actually better to use in the long run.

                                                                – Corey Whitaker
                                                                Jul 10 '12 at 13:45






                                                              • 1





                                                                Or use single quotes ('Radna površina'), if you don't want environment variables ($VARNAME) to be expanded and commands enclosed in backticks or $() to be run (or if there are double-quotes in the filename).

                                                                – Eliah Kagan
                                                                Jul 10 '12 at 13:49
















                                                              6












                                                              6








                                                              6







                                                              To open a folder containing a space surround it in quotes like cd "Some Directory" or escape the space with a backslash, like: cd /home/kudic/Radna površina.






                                                              share|improve this answer















                                                              To open a folder containing a space surround it in quotes like cd "Some Directory" or escape the space with a backslash, like: cd /home/kudic/Radna površina.







                                                              share|improve this answer














                                                              share|improve this answer



                                                              share|improve this answer








                                                              edited Jul 10 '12 at 13:46









                                                              Javier Rivera

                                                              30k978101




                                                              30k978101










                                                              answered Jul 10 '12 at 13:41









                                                              Corey WhitakerCorey Whitaker

                                                              855712




                                                              855712








                                                              • 3





                                                                Or escape the space with a backslash, like: cd /home/kudic/Radna površina

                                                                – Timo
                                                                Jul 10 '12 at 13:43











                                                              • Great point! I forgot to mention that. I normally use quotes out of habit, but the backslash is actually better to use in the long run.

                                                                – Corey Whitaker
                                                                Jul 10 '12 at 13:45






                                                              • 1





                                                                Or use single quotes ('Radna površina'), if you don't want environment variables ($VARNAME) to be expanded and commands enclosed in backticks or $() to be run (or if there are double-quotes in the filename).

                                                                – Eliah Kagan
                                                                Jul 10 '12 at 13:49
















                                                              • 3





                                                                Or escape the space with a backslash, like: cd /home/kudic/Radna površina

                                                                – Timo
                                                                Jul 10 '12 at 13:43











                                                              • Great point! I forgot to mention that. I normally use quotes out of habit, but the backslash is actually better to use in the long run.

                                                                – Corey Whitaker
                                                                Jul 10 '12 at 13:45






                                                              • 1





                                                                Or use single quotes ('Radna površina'), if you don't want environment variables ($VARNAME) to be expanded and commands enclosed in backticks or $() to be run (or if there are double-quotes in the filename).

                                                                – Eliah Kagan
                                                                Jul 10 '12 at 13:49










                                                              3




                                                              3





                                                              Or escape the space with a backslash, like: cd /home/kudic/Radna površina

                                                              – Timo
                                                              Jul 10 '12 at 13:43





                                                              Or escape the space with a backslash, like: cd /home/kudic/Radna površina

                                                              – Timo
                                                              Jul 10 '12 at 13:43













                                                              Great point! I forgot to mention that. I normally use quotes out of habit, but the backslash is actually better to use in the long run.

                                                              – Corey Whitaker
                                                              Jul 10 '12 at 13:45





                                                              Great point! I forgot to mention that. I normally use quotes out of habit, but the backslash is actually better to use in the long run.

                                                              – Corey Whitaker
                                                              Jul 10 '12 at 13:45




                                                              1




                                                              1





                                                              Or use single quotes ('Radna površina'), if you don't want environment variables ($VARNAME) to be expanded and commands enclosed in backticks or $() to be run (or if there are double-quotes in the filename).

                                                              – Eliah Kagan
                                                              Jul 10 '12 at 13:49







                                                              Or use single quotes ('Radna površina'), if you don't want environment variables ($VARNAME) to be expanded and commands enclosed in backticks or $() to be run (or if there are double-quotes in the filename).

                                                              – Eliah Kagan
                                                              Jul 10 '12 at 13:49













                                                              3














                                                              If this directory is in your home folder then type:



                                                              cd "Milano, Torino (Jan)-Compressed"


                                                              else give absolute path:



                                                              cd "/…/…/Milano, Torino (Jan)-Compressed"


                                                              if there is a double quote in file name then escape that with "






                                                              share|improve this answer


























                                                              • If you start a path with a leading forward slash, it goes from root. You might want to remove that.

                                                                – isaaclw
                                                                Feb 5 '12 at 21:52











                                                              • @isaaclw That is why he filed it as an absolute path :P

                                                                – user13091
                                                                Feb 6 '12 at 1:16






                                                              • 1





                                                                Ah, that's three dots, indicating a "variable" folder. I assumed it was two dots, indicating "parent folder". Apologies.

                                                                – isaaclw
                                                                Feb 6 '12 at 3:43
















                                                              3














                                                              If this directory is in your home folder then type:



                                                              cd "Milano, Torino (Jan)-Compressed"


                                                              else give absolute path:



                                                              cd "/…/…/Milano, Torino (Jan)-Compressed"


                                                              if there is a double quote in file name then escape that with "






                                                              share|improve this answer


























                                                              • If you start a path with a leading forward slash, it goes from root. You might want to remove that.

                                                                – isaaclw
                                                                Feb 5 '12 at 21:52











                                                              • @isaaclw That is why he filed it as an absolute path :P

                                                                – user13091
                                                                Feb 6 '12 at 1:16






                                                              • 1





                                                                Ah, that's three dots, indicating a "variable" folder. I assumed it was two dots, indicating "parent folder". Apologies.

                                                                – isaaclw
                                                                Feb 6 '12 at 3:43














                                                              3












                                                              3








                                                              3







                                                              If this directory is in your home folder then type:



                                                              cd "Milano, Torino (Jan)-Compressed"


                                                              else give absolute path:



                                                              cd "/…/…/Milano, Torino (Jan)-Compressed"


                                                              if there is a double quote in file name then escape that with "






                                                              share|improve this answer















                                                              If this directory is in your home folder then type:



                                                              cd "Milano, Torino (Jan)-Compressed"


                                                              else give absolute path:



                                                              cd "/…/…/Milano, Torino (Jan)-Compressed"


                                                              if there is a double quote in file name then escape that with "







                                                              share|improve this answer














                                                              share|improve this answer



                                                              share|improve this answer








                                                              edited Feb 5 '12 at 19:06









                                                              sladen

                                                              5,39612027




                                                              5,39612027










                                                              answered Feb 5 '12 at 12:00









                                                              Harshveer SinghHarshveer Singh

                                                              346138




                                                              346138













                                                              • If you start a path with a leading forward slash, it goes from root. You might want to remove that.

                                                                – isaaclw
                                                                Feb 5 '12 at 21:52











                                                              • @isaaclw That is why he filed it as an absolute path :P

                                                                – user13091
                                                                Feb 6 '12 at 1:16






                                                              • 1





                                                                Ah, that's three dots, indicating a "variable" folder. I assumed it was two dots, indicating "parent folder". Apologies.

                                                                – isaaclw
                                                                Feb 6 '12 at 3:43



















                                                              • If you start a path with a leading forward slash, it goes from root. You might want to remove that.

                                                                – isaaclw
                                                                Feb 5 '12 at 21:52











                                                              • @isaaclw That is why he filed it as an absolute path :P

                                                                – user13091
                                                                Feb 6 '12 at 1:16






                                                              • 1





                                                                Ah, that's three dots, indicating a "variable" folder. I assumed it was two dots, indicating "parent folder". Apologies.

                                                                – isaaclw
                                                                Feb 6 '12 at 3:43

















                                                              If you start a path with a leading forward slash, it goes from root. You might want to remove that.

                                                              – isaaclw
                                                              Feb 5 '12 at 21:52





                                                              If you start a path with a leading forward slash, it goes from root. You might want to remove that.

                                                              – isaaclw
                                                              Feb 5 '12 at 21:52













                                                              @isaaclw That is why he filed it as an absolute path :P

                                                              – user13091
                                                              Feb 6 '12 at 1:16





                                                              @isaaclw That is why he filed it as an absolute path :P

                                                              – user13091
                                                              Feb 6 '12 at 1:16




                                                              1




                                                              1





                                                              Ah, that's three dots, indicating a "variable" folder. I assumed it was two dots, indicating "parent folder". Apologies.

                                                              – isaaclw
                                                              Feb 6 '12 at 3:43





                                                              Ah, that's three dots, indicating a "variable" folder. I assumed it was two dots, indicating "parent folder". Apologies.

                                                              – isaaclw
                                                              Feb 6 '12 at 3:43











                                                              3














                                                              Another option although not the best in this case is to use wildcards. You can try:



                                                              cd *Torino*



                                                              It is best to use this method when there is a distinct word or phrase in the name of a directory not shared by others. For example I have mount points /media/DataSSD and /media/DataHDD. Autocompletion doesn't work until I type nearly half of the name so to get to my HDD partition I just type



                                                              cd /media/*HD*






                                                              share|improve this answer




























                                                                3














                                                                Another option although not the best in this case is to use wildcards. You can try:



                                                                cd *Torino*



                                                                It is best to use this method when there is a distinct word or phrase in the name of a directory not shared by others. For example I have mount points /media/DataSSD and /media/DataHDD. Autocompletion doesn't work until I type nearly half of the name so to get to my HDD partition I just type



                                                                cd /media/*HD*






                                                                share|improve this answer


























                                                                  3












                                                                  3








                                                                  3







                                                                  Another option although not the best in this case is to use wildcards. You can try:



                                                                  cd *Torino*



                                                                  It is best to use this method when there is a distinct word or phrase in the name of a directory not shared by others. For example I have mount points /media/DataSSD and /media/DataHDD. Autocompletion doesn't work until I type nearly half of the name so to get to my HDD partition I just type



                                                                  cd /media/*HD*






                                                                  share|improve this answer













                                                                  Another option although not the best in this case is to use wildcards. You can try:



                                                                  cd *Torino*



                                                                  It is best to use this method when there is a distinct word or phrase in the name of a directory not shared by others. For example I have mount points /media/DataSSD and /media/DataHDD. Autocompletion doesn't work until I type nearly half of the name so to get to my HDD partition I just type



                                                                  cd /media/*HD*







                                                                  share|improve this answer












                                                                  share|improve this answer



                                                                  share|improve this answer










                                                                  answered Feb 2 '14 at 17:38









                                                                  user242845user242845

                                                                  311




                                                                  311






























                                                                      draft saved

                                                                      draft discarded




















































                                                                      Thanks for contributing an answer to Ask Ubuntu!


                                                                      • Please be sure to answer the question. Provide details and share your research!

                                                                      But avoid



                                                                      • Asking for help, clarification, or responding to other answers.

                                                                      • Making statements based on opinion; back them up with references or personal experience.


                                                                      To learn more, see our tips on writing great answers.




                                                                      draft saved


                                                                      draft discarded














                                                                      StackExchange.ready(
                                                                      function () {
                                                                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f101587%2fhow-do-i-enter-a-file-or-directory-with-special-characters-in-its-name%23new-answer', 'question_page');
                                                                      }
                                                                      );

                                                                      Post as a guest















                                                                      Required, but never shown





















































                                                                      Required, but never shown














                                                                      Required, but never shown












                                                                      Required, but never shown







                                                                      Required, but never shown

































                                                                      Required, but never shown














                                                                      Required, but never shown












                                                                      Required, but never shown







                                                                      Required, but never shown







                                                                      Popular posts from this blog

                                                                      List of shipwrecks in 1808...

                                                                      Is there a lightweight tool to crop images quickly?Cropping Images using Command Line Tools OnlyHow to crop...