Linux daily used command.
pwd: show current working directory
Command: pwdOutput:/home/ubuntu
cd: Change directory
Command: cd /directorynamei.e cd /home
mkdir: Create a new directory
Command: mkdir {directoryname}
rm -rf: Delete files and directory
Command: rm -rf {directory}
ls: List of directory
Command: lsOutput: bin games include lib local sbin share src
ll: List of the directory with details
Command: llOutput:drwxr-xr-x 10 root root 4096 Aug 10 17:57 ./drwxr-xr-x 2 root root 24576 Dec 18 06:42 bin/drwxr-xr-x 5 root root 4096 Sep 10 08:21 include/
top: The program produces an ordered list of running processes selected by user-specified criteria
Command: topOutputtop - 17:08:55 up 155 days, 23:10, 1 user, load average: 0.00, 0.00, 0.00Tasks: 98 total, 1 running, 57 sleeping, 0 stopped, 0 zombie%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 stKiB Mem : 1002108 total, 143040 free, 625612 used, 233456 buff/cacheKiB Swap: 0 total, 0 free, 0 used. 227784 avail MemPID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND3409 ubuntu 20 0 2423768 452520 0 S 0.3 45.2 50:43.27 java1 root 20 0 159976 5364 2832 S 0.0 0.5 1:39.48 systemd2 root 20 0 0 0 0 S 0.0 0.0 0:00.14 kthreadd
htop: htop is an interactive system-monitor process-viewer and process-manager. It is designed as an alternative to the Unix program top.
kill: kill the running process
Command: kill -9 pidi.e kill -9 1221
history: It returns the list of all previously executed commands.
Command: historyOutput:208 ls209 ll210 top211 htop212 top213 hostory
tail: The tail command is used to print the last 10 lines of a file by default.
Command: tailOutput:at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:553)at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:260)at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1594)at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)at java.base/java.lang.Thread.run(Thread.java:834)
tail -f: Output the content of the file as it grows to start with the last 10 lines.
Command: tail -fOutput:at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:553)at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:260)at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1594)at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)at java.base/java.lang.Thread.run(Thread.java:834)
Check the application running PID.
Command: ps aux | grep 'java -jar';ubuntu 3409 0.1 45.1 2423768 452520 ? Sl 2020 50:44java -jar -Dspring.profiles.active=aws app.jar
No comments:
Post a Comment