This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
user:adahmane:portfolio:unixproject2 [2013/12/11 19:49] – [Project: YOUR PROJECT NAME HERE] adahmane | user:adahmane:portfolio:unixproject2 [2013/12/11 19:55] (current) – adahmane | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======Case Study 0x2: Unconventional Naming====== | ||
+ | The second case study in the greatest class I will ever take. I will learn how to work with difficultly named files! | ||
+ | =====Objectives===== | ||
+ | Learn how to give commands with poorly named files. I will finish this case study with the knowledge required to call up files with spaces, odd characters, etc. | ||
+ | |||
+ | =====Procedure===== | ||
+ | <cli> | ||
+ | lab46: | ||
+ | challenge | ||
+ | lab46: | ||
+ | total 4 | ||
+ | drwxr-x--- 2 adahmane lab46 28 Feb 10 2004 . | ||
+ | drwxr-x--- 5 adahmane lab46 51 Sep 17 2010 .. | ||
+ | -rw-r----- 1 adahmane lab46 39 Dec 2 2001 look at me.text | ||
+ | lab46: | ||
+ | ls: cannot access exe: No such file or directory | ||
+ | lab46: | ||
+ | total 44 | ||
+ | -rw-r----- 1 adahmane lab46 43 Feb 10 2004 #pico28903# | ||
+ | -rw-r----- 1 adahmane lab46 28 Feb 10 2004 $USER VALUE$ | ||
+ | -rw-r----- 1 adahmane lab46 23 Feb 10 2004 ( parenthesis & other odd things ) | ||
+ | -rw-r----- 1 adahmane lab46 72 Feb 10 2004 *** watch out! *** | ||
+ | drwxr-x--- 2 adahmane lab46 4096 Feb 10 2004 . | ||
+ | drwxr-x--- 5 adahmane lab46 51 Sep 17 2010 .. | ||
+ | -rw-r----- 1 adahmane lab46 42 Dec 2 2001 ??? can you delete me ???.abc | ||
+ | -rw-r----- 1 adahmane lab46 35 Feb 10 2004 `ls` * HI! * | ||
+ | -rw-r----- 1 adahmane lab46 50 Dec 2 2001 change my\ name.file | ||
+ | -rw-r----- 1 adahmane lab46 52 Dec 2 2001 compress " | ||
+ | -rw-r----- 1 adahmane lab46 40 Feb 10 2004 just a simple file.txt | ||
+ | -rw-r----- 1 adahmane lab46 46 Feb 10 2004 one, ' | ||
+ | lab46: | ||
+ | total 4 | ||
+ | -rw-r----- 1 adahmane lab46 56 Dec 16 2001 - challenge round - | ||
+ | drwxr-x--- 2 adahmane lab46 32 Sep 28 2012 . | ||
+ | drwxr-x--- 5 adahmane lab46 51 Sep 17 2010 .. | ||
+ | </ | ||
+ | |||
+ | Below are the files I decided to cat using the wildcards learned in the case study... | ||
+ | |||
+ | Using the * wildcard: | ||
+ | <cli> | ||
+ | lab46: | ||
+ | this file has spaces and double quotes in its name. | ||
+ | lab46: | ||
+ | spaces, commas, two types of quotes... oh my! | ||
+ | lab46: | ||
+ | This file has spaces and a backslash in its name. | ||
+ | </ | ||
+ | |||
+ | Using the \ escape character: | ||
+ | <cli> | ||
+ | lab46: | ||
+ | laLAA... pretend this is a pico temp file. | ||
+ | lab46: | ||
+ | Care must be taken when using the ' | ||
+ | lab46: | ||
+ | This file has spaces and ?'s in its name. | ||
+ | </ | ||
+ | |||
+ | Using the shell quoting facilities: | ||
+ | <cli> | ||
+ | lab46: | ||
+ | Simple, but simpler without the spaces! | ||
+ | lab46: | ||
+ | Are we having fun yet? | ||
+ | lab46: | ||
+ | This file has spaces and ?'s in its name. | ||
+ | </ | ||
+ | |||
+ | I had to use the man to figure out the last one: | ||
+ | <cli> | ||
+ | lab46: | ||
+ | lab46: | ||
+ | rm: remove regular file `- challenge round -'? yes | ||
+ | lab46: | ||
+ | </ |