본문 바로가기

우분투

(10)
디렉토리에서 가장 최근 파일의 이름 바꾸기 디렉토리에서 가장 최근 파일 이름 바꾸는 법을 알아보자. mv명령어를 이용하므로, 이름말고 위치를 바꿀 때도 동일하게 사용하면 된다. ls -tr | tail -1 | xargs -I{} mv {} new_name 해석: ls -tr : 시간(-t)을 내림차순(-r)으로 정렬해서 보여준다(ls) | tail -1 : 앞 명령어로 나온 결과중에 ( | ) 맨 마지막 한 가지만 고른다 (tail -1) | xargs -I {} mv {} new_name : 앞 명령어 결과를 이용하여 (|) 다음 명령어의 인자로 전달한다 (xargs) 전달하는 위치는 다음 변수가 있는 곳으로 한다 (-I, {}... {}는 변수 이름이고 변경 가능) 전달받은 인자의 이름을 new_name으로 바꾼다 ( mv {} new_na..
jmeter cli로 실행 시 각종 파라미터 넘기기(ip, thread, port 등) jmeter를 cli로 사용하는 법을 알아보자. cli로 실행할때마다 ip주소를 유동적으로 넘겨주고 싶다면 아래 포스팅 참고 https://mkbansal.wordpress.com/2012/08/01/jmeter-command-line-script-execution-with-arguments/ Jmeter – command line script execution with arguments Its a common practice to create Performance script in GUI mode and run the test in CUI (command user interface) mode. Some time we need to pass some arguments to script as input. ..
[Error] 도커에서 mpirun실행시 errno=1 에러 mpirun을 했는데 이런 에러가 뜬다. > Read -1, expected 13212, errno = 1 원인은 CMA였다. 도커에서 쓰는 네임스페이스가 host와 달라서 그렇다나 뭐라나 해결방법: 도커 안에서 다음 명령을 실행한다. $ export OMPI_MCA_btl_vader_single_copy_mechanism=none 참고 https://github.com/open-mpi/ompi/issues/4948 Vader in a Docker Container · Issue #4948 · open-mpi/ompi Background information What version of Open MPI are you using? (e.g., v1.10.3, v2.1.0, git branch name an..
하이퍼쓰레드 켜고 끄기 하이퍼쓰레딩 확인하기 제일 편한 방법: `lscpu`명령 방법 1; siblings 가 cpu core 2배면 hyperthreading on cat /proc/cpuinfo | egrep 'siblings|cpu cores' | head -2 방법 2 ; Thread Count가 Core Count의 2배면 hyperthreading on dmidecode -t processor | egrep 'Core Count|Thread Count' | head -2 방법 3; hyperthreading on이면 HTT(Hyper-threading), off면 HTT(Multi-threading) dmidecode -t processor | grep HTT | head -1 하이퍼쓰레드 설정 bash파일 만들기 ..
LiveCD를 이용해서 루트 디렉토리 fsck 실행하기 fsck: file system check . 파일 검사 & 수리하는 명령어. 루트 디렉토리에 fsck를 실행하면 아래와 같은 경고문구가 뜨며 실행이 되지 않는다. 뭐시기뭐시기/ is mounted. Cannot continue, aborting. 이유는 루트 디렉토리가 mount된 상태이기 때문이다. liveCD를 이용해서 루트 디렉토리에 fsck를 실행하는 방법을 알아보자. 1. Live CD ( Install USB )에서 Try Ubuntu 실행 컴퓨터를 재시작한다. F11을 눌러 부팅 디스크를 _ubuntu install usb_로 선택한다. USB로 부팅이 됐다면 Try Ubuntu를 실행한다. Nvidia 그래픽카드를 쓰는 경우 만약 Nvidia 그래픽카드를쓴다면 Try Ubuntu가 실행이..
내가 만든 프로그램을 터미널에서 명령어처럼 사용하기 방법은 두 가지 1. 환경변수에 프로그램을 등록하는 방법 2. 프로그램 자체를 path 폴더에 넣는 방법 환경변수에 프로그램 등록하기 $ export PATH=$PATH:/any/folder/you/want $ echo $PATH # PATH 확인하기 $ source ~/.bashrc https://askubuntu.com/questions/500775/permanent-path-variable
C/C++로 터미널에 명령어 전달하기. C/C++프로그램으로 터미널을 실행해서 명령어를 전달해보자. `system`함수를 이용한다. 코드 예제 #include #include using namespace std; int main() { //명령어 입력 cout command; //str을 char*로 변환 const char *c = command.c_str(); //터미널에 명령어 전달 system(c); return 0; } 실행결과 참고 https://www.quora.com/How-do-I-use-terminal-commands-in-C++ How do I use terminal commands in C++? Answer (1 of 2): system() in C/C++ system() is used to invoke an operat..
Ubuntu 터치패드를 편하게! :: Fusuma 우분투 터치패드에 제스쳐를 설정해줘서 편하게 쓰자. 한 번 설정해줬더니 이젠 마우스보다 편하다. Fusuma라는 툴을 이용한다. 설치도 간단하고 사용법도 간단하다. 강력추천!! 설치방법 1. 유저를 input 그룹에 추가 $ sudo gpasswd -a $USER input 2. libinput-tools 설치 $ sudo apt-get install libinput-tools 3. Ruby 설치 $ sudo apt-get install ruby 4. Fusuma 설치 $ sudo gem install fusuma 5. xdotool 설치 $ sudo apt-get install xdotool 6. 만약 GNOME에서 터치패드 작동이 안된다면 다음 명령어 입력 $ gsettings set org.gnom..