User Tools

Site Tools


linux-survival

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-survival [2025/10/08 10:17] – [The Linux terminal] jonaslinux-survival [2026/05/13 12:52] (current) jonas
Line 18: Line 18:
  
 UNDER CONSTRUCTION UNDER CONSTRUCTION
-<del>  ***//SSH//**+***//SSH//**
  
-SSH stands for Secure Shell. It is a command-line protocol which provides strong password authentication and public key authentication, as well as encrypted data communications between two computers connecting over an open network, such as the internet. To be able to connect to the server //psycomp.rhul.ac.uk// over SSH, open the command-line terminal and use the following command:+SSH stands for Secure Shell. It is a command-line protocol which provides strong password authentication and public key authentication, as well as encrypted data communications between two computers connecting over an open network, such as the internet. It is run from the command line as follows: 
 + 
 +<del> 
 +To be able to connect to the server //psycomp.rhul.ac.uk// over SSH, open the command-line terminal and use the following command:
  
  
Line 114: Line 117:
 ls ~ ls ~
 </code> </code>
 +
 +%%|%% Pipe symbol
 +
 +A //pipe// in Linux is a connection between two programs or commands - it basically acts as a "pipe" that sends the output of one command to be the input of another. It works primarily for text files but can be very useful. For example, you might want to look at all the strings in a binary data file like a DICOM to find a participants date of birth. You can use the command //strings// to extract the text information from the file, but as it's a lot you want to be able to look at it one page at a time. For this you would use the command //more//. more takes a text file as input, but can also use the output of another file as a pipe. To do this you type the first command followed by the vertical pipe symbol | and then the second command. So to look at the text content of a file called mydicom.IMA, you could type
 +
 +<code>
 +# print out the strings (text data) in the file mydicom.IMA and display it one page at a time using more
 +strings mydicom.IMA | more
 +</code>
 +
 +
  
  
Line 286: Line 300:
 Syntax: cp <input file> <output file name or directory> Syntax: cp <input file> <output file name or directory>
 <code sh> <code sh>
 +cp myfile1 myfile1copy
 </code> </code>
 == rm - remove files == == rm - remove files ==
Line 329: Line 344:
 == find - find files == == find - find files ==
  
-Syntax: +Syntax: find <location> <file pattern>
 <code sh> <code sh>
 +# find files containing the string yfi in your home directory and folders within it
 +# Note that the string *yfi* has to be in double quotes - this is because we want the command 
 +# find to look for anything matching that pattern; without it, the shell (where you run your command from)
 +# tries to expand the pattern (i.e., look for files in your current folder that match that pattern) and
 +# send the result of that "match" to find, which is not what you want. If in doubt, include the string
 +# that you want to match in double quotes.
 +find ~/ "*yfi*"
 </code> </code>
-== grep - find text in a file == 
  
-Syntax:  +== strings - extract text from a binary file == 
-<code sh>+ 
 +Syntax: strings <filename> 
 +<code> 
 +# Print out all strings in a DICOM file called mydicom.IMA 
 +strings mydicom.IMA 
 + 
 +== grep - find strings matching pattern in a text file == 
 + 
 +Syntax: grep <text pattern> <file/s>  
 +<code sh>  
 +# Find the string jonas in the file passwords.txt 
 +grep jonas passwords.txt
 </code> </code>
 == sort - sort text == == sort - sort text ==
linux-survival.1759918627.txt.gz · Last modified: 2025/10/08 10:17 by jonas

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki