User Tools

Site Tools


linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux [2022/07/16 18:10] rogerlinux [2023/01/11 10:33] (current) – [Print the first column of a string] roger
Line 131: Line 131:
 What's happening? What's happening?
  
-  * First, we are performing a ''find'' command. The output is going to look like this:+  * First, we are performing a [[linux#find|find]] command. The output is going to look like this:
 <code bash> <code bash>
 ./folder/this_is_a_json.json ./folder/this_is_a_json.json
Line 141: Line 141:
  
 This command in particular is very usefull to check if all the JSON files in a repository are well formated in a CI/CD step. This command in particular is very usefull to check if all the JSON files in a repository are well formated in a CI/CD step.
 +
 +===== ncdu =====
 +
 +Ncdu is a disk usage analyzer with an ncurses interface. It is designed to find space hogs on a remote server where you don’t have an entire graphical setup available, but it is a useful tool even on regular desktop systems. Ncdu aims to be fast, simple and easy to use, and should be able to run in any minimal POSIX-like environment with ncurses installed.
 +
 +Usage:
 +
 +<code bash>
 +ncdu -x /
 +</code>
 +
 +Where ''/'' is the filesystem you want to check
 +
 +===== awk =====
 +
 +==== Print the first column of a string ====
 +
 +<code bash>
 +echo "This is a string" | awk '{print ($1)}'
 +# Output: "This"
 +</code>
 +
 +==== Print a full string in lowercase or uppercase ====
 +
 +<code bash>
 +echo "This Is A CaPiTaLiZeD String" | awk '{print tolower($0)}'
 +# Output: "this is a capitalized string"
 +
 +echo "This Is A CaPiTaLiZeD String" | awk '{print toupper($0)}'
 +# Output: "THIS IS A CAPITALIZED STRING"
 +</code>
linux.1658005805.txt.gz · Last modified: 2023/01/01 18:43 (external edit)