ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Command Line
    Command Line 2021. 10. 15. 10:43

    이 글은 웹 개발에 필요한 기본적인 커맨드라인에 관한 개념들을
    정리하기 위해 작성하였습니다.




    < Command Line >

    The command line is a text interface for your computer. It’s a program that takes in commands and passes them on to the computer’s operating system to run.

    From the command line, you can navigate through files and folders on your computer, just as you would with Finder on Mac OS or Windows Explorer on Windows. The difference is that the command line is fully text-based.

     

     


    < File System >

    A file system organizes a computer's files and directories into a tree strueture.

     

    1. The first directory in the file system is root directory. It is the parent of all other directories and files in the file system.
    2. Each parent directory can contain more child directories and files.
      In the file system on the below, blog/ is the parent of 2014/, 2015/, and hardware.txt

     

     

     


    < ls >

    To list all the files and directories inside of the working directory.

     

    ex)

    # if we typed 'ls' in the /blog directory
    $ls
    2014   2015   hardware.txt

     

     


    < pwd >

    To see the name of the directory you're currently in, called the working directory.

    It stands for 'pring working directory'.

     

    ex)

    # if we typed 'pwd' in the /blog directory
    $pwd
    home/ccuser/workspace/blog

     


    < cd >

    To change working directory. It stands for 'change directory'.

     

    ex)

    # pwd : /home/ccuser/workspace/blog
    
    # Transfer into the 2015/jan directory
    $cd 2015/jan
    $pwd
    /home/ccuser/workdspace/blog/2015/jan
    
    # To move up one directory, use 'cd ..'
    $cd ..
    $pwd
    /home/ccuser/workdspace/blog/2015

     

    • When a file, directory, or program is passed into a command, it is called a argument.
      Here the 2015/jan is an argument for the cd command.

     


    < mkdir >

    To create a new directory inside the working directory. It stands for 'make directory'.

     

    ex)

    # to make 'media' directory
    $mkdir media
    
    # to make 'tv' directory inside media directory
    $mkdir media/tv

     

     


    < touch >

    To create a new file inside the working directory.

     

    ex)

    # to make 'keyboard.txt' file
    $touch keyboard.txt
    $ls
    keyboard.txt

     

     


    < Helper Commands >

    To make using command line easier!

     

    1. clear : to clear your terminal, which is useful when it’s full of previous commands and outputs. It doesn’t change or undo your previous commands, it just clears them from the view. You can scroll upwards to see them at any time.
    2. tab : to autocomplete your command. When you are typing the name of an existing file or directory, you can use tab to finish the rest of the name.
    3. ↑, ↓ : to cycle your previous commands.↑ will take you up through your most recent commands,
      and 
       will take you back through to the most recent one. 

     

     

     

     

     

    댓글

Designed by Tistory.