티스토리 뷰

sudo apt-get update

* apt(Advance Packging Tools)

설치 되어 있는 패키지들의 새로운 버전이 있는지 확인할 때 사용한다.

sudo apt update
//or
sudo apt-get update
  1. The sudo apt-get update command is used to download package information from all configured sources.
  2. The sources often defined in the /etc/apt/sources.list file and other files located in /etc/apt/sources.list.d directory.
  3. So when you run update command, it downloads the package information from the Internet. It is useful to get info on an updated version of packages or their dependencies.

update is used to resynchronize the package index files from their sources. The indexes of available packages are fetched from the location(s) specified in /etc/apt/sources.list. For example, when using a Debian archive, this command retrieves and scans the Packages.gz files, so that information about new and updated packages is available. An update should always be performed before an upgrade or dist-upgrade. Please be aware that the overall progress meter will be incorrect as the size of the package files cannot be known in advance.

sudo apt-get upgrade

위의 update 명령어를 사용해 확인한 패키지들을 업데이트하는데 사용한다.

sudo apt-get upgrade
  1. Now you know sudo apt-get update command gets you an updated list of packages from the Internet.
  2. You run sudo apt-get upgrade to install available upgrades of all packages currently installed on the system from the sources configured via sources.list file.
  3. New packages will be installed if required to satisfy dependencies, but existing packages will never be removed.

upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. New versions of currently installed packages that cannot be upgraded without changing the install status of another package will be left at their current version. An update must be performed first so that apt-get knows that new versions of packages are available.


apt 명령어를 실행하려면 Java가 있어야 하는 것 같아서 깔았는데 소용이 없었다.

여전히 The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt. 가 떴다.

그래서 찾아보니 mac에서는 brew를 이용해서 설치하면 된다고 한다!

+ 그런데도 안된다 ㅠㅠ

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

출처

 

calender

명령어를 입력한 날짜들에 무슨 일이 일어났는지 확인할 수 있는 이스터에그

calendar

+ 그래서 이 명령어도 사용이 안된다 ㅠㅠ


 

pwd (print working directory)

현재 어느 경로에 위치하고 있는지 보여줌

pwd

 

ls

현재 위치하고 있는 경로의 폴더와 파일을 보여줌

ls // 현재 경로의 파일과 폴더를 보여줌
ls {folder} // 폴더에 들어가지 않고 이름을 넣은 폴더의 파일과 폴더들을 보여줌
ls -t // 최근 수정한 순서로 폴더를 보여줌
ls -s // 크기 순서로 작은 크기의 폴더부터 보여줌
ls -l // 파일들의 자세한 정보를 보여줌
ls -r // 알파벳 역순으로 보여줌
ls -a // 숨겨진 파일을 포함한 모든 파일을 보여줌
ls -R // 하위 디렉토리까지 모든 파일을 보여줌

ls --help // ls 커맨드에 대한 설명서를 보여줌

 

cd (change directory)

cd {folder name} // 이름을 적은 폴더로 들어감
cd // 홈 경로로 돌아옴
cd .. // 상위 경로로 돌아감

 

tab키를 사용하면 자동완성을 사용할 수 있음

대신 앞글자가 같은 경로가 여러개 있다면 글자를 더 입력해줘야함

cd doc// +tab
// cd docments 가 자동으로 완성됨

 

clear

터미널의 내용들이 다 지워짐

clear

 

mkdir(make a directory)

디렉토리를 만듦

midir {directory name}

 

rmdir(remove a directory)

디렉토리를 삭제함

rmdir {directory name}

 

터미널에 프로그램 이름을 입력하면 실행된다!

 

Ctrl + C

하던 프로그램 종료

 

cp(copy)

파일을 복사함

cp {file name} {directory} // directory에 file name파일을 복사함

 

sh(bash)

쉘 스크립트 실행

bash {file name}
//or
sh {file name}
//or
./{file name}

 

sudo(super user do)

실행권한이 없는 명령을 실행할 때 사용함

sudo {anything} // 앞에 sudo를 붙이고 여러 명령어를 사용할 수 있음

 

커스텀 터미널 커맨드를 만드려면 bin폴더에 넣으면 된다

728x90
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
글 보관함