Difference between revisions of "Kinky linux command-line"

From Gender and Tech Resources

m
m (Command Line Culture (CLIC))
Line 13: Line 13:
  
 
''Since bodies and machines are often seen in opposition, I suggest that they are better perceived complementary in nature rather than antagonistic. For people who have never worked with command line computing on a standard *nix machine, – especially for people who are already conditioned to point and click methods cultivated by GUIs such as Windows OS or Mac OS – this involves sensitising procedures, (i.e. like one may endure with any new  instrumental skill acquisition) for the operation of code as a series of interrelated programs. I will discuss how using the command line interface may be seen to possibly co-constitute one another in everyday life, operating as fields of embodied reflection. ''<ref>Linux for Theatre Makers: Embodiment and *nix modus operandi http://networkcultures.org/blog/2007/04/23/linux-for-theatre-makers-embodiment-and-nix-modus-operandi/</ref>
 
''Since bodies and machines are often seen in opposition, I suggest that they are better perceived complementary in nature rather than antagonistic. For people who have never worked with command line computing on a standard *nix machine, – especially for people who are already conditioned to point and click methods cultivated by GUIs such as Windows OS or Mac OS – this involves sensitising procedures, (i.e. like one may endure with any new  instrumental skill acquisition) for the operation of code as a series of interrelated programs. I will discuss how using the command line interface may be seen to possibly co-constitute one another in everyday life, operating as fields of embodied reflection. ''<ref>Linux for Theatre Makers: Embodiment and *nix modus operandi http://networkcultures.org/blog/2007/04/23/linux-for-theatre-makers-embodiment-and-nix-modus-operandi/</ref>
 +
 +
A lof of commands in linux are named as an abbreviation of a word or words describing them.  This makes it easier to remember them.
  
 
== Getting started ==
 
== Getting started ==
Line 19: Line 21:
 
The manual pages are a set of pages that explain every command available on your system including what they do, the specifics of how you run them and what command line arguments they accept. They are fairly consistent in their structure so you can easily get the hang of it.  Start up a console or terminal and invoke the manual pages with the following command:
 
The manual pages are a set of pages that explain every command available on your system including what they do, the specifics of how you run them and what command line arguments they accept. They are fairly consistent in their structure so you can easily get the hang of it.  Start up a console or terminal and invoke the manual pages with the following command:
  
$ man <command>
+
$ man [command]
  
 
For example:
 
For example:
  
$ man grep
+
$ man grep
  
 
[[File:Man-grep.png|640px|thumb|center]]
 
[[File:Man-grep.png|640px|thumb|center]]
Line 33: Line 35:
 
* <em>named pipes</em> and <em>sockets</em> give access points for processes to communicate with each other
 
* <em>named pipes</em> and <em>sockets</em> give access points for processes to communicate with each other
 
* (hard and soft) <em>links</em> make a file accessible from different locations
 
* (hard and soft) <em>links</em> make a file accessible from different locations
 +
With '''pwd''' ('''p'''resent '''w'''orking '''d'''irectory) you can see your location in the file structure.
 +
 +
$ pwd
 +
/home/user
 +
$
 +
 +
With '''ls''' () you can see what is in a location:
 +
 +
$ ls [options] [location]
 +
 +
For example
 +
 +
$ ls -l /home/user
 +
total 20
 +
drwxr-xr-x 2 user user 4096 Jun 17 14:39 Desktop
 +
drwxr-xr-x 2 user user 4096 Jul  2 00:45 Documents
 +
drwxr-xr-x 4 user user 4096 Jul  2 00:46 Pictures
 +
 +
The result lines explained
 +
 +
* The first character on a result line indicates whether it is a normal file (-) or a directory (d).
 +
* The next 9 characters are permissions for the file or directory. More on that in file permissions below.
 +
* A character representing the number of blocks.
 +
* The field following that is the owner of the file or directory (user in this case).
 +
* The group the file or directory belongs to (user)
 +
* File size
 +
* File modification time
 +
* Name of the file or directory
 +
 +
For more explanation on and examples of using ls do:
 +
 +
$ man ls
 +
 
From the command line, there are many ways to create, find and list different types of files. You can determine the type of a file with the file command:
 
From the command line, there are many ways to create, find and list different types of files. You can determine the type of a file with the file command:
 
  $ file privatelyinvestigating.wordpress.2015-05-02.xml  
 
  $ file privatelyinvestigating.wordpress.2015-05-02.xml  

Revision as of 17:08, 8 July 2015

Graphical user interfaces (GUIs) are helpful for many tasks, but they box you in in the tasks the designer designed the GUI for. This is true to a certain extent for the command-line too, as it relies on the commands available. Still, some commands are so basic (close to the kernel), and come with many flags and options, or can be built on easily and be combined with other commands in shell scripts, that knowing the command-line and shell scripting is well worth the effort.

Farceof the Pinguins: A mockumentary that illuminates penguin survival and mating rituals, as well as one bird's search for love while on a 70-mile trek with his hedonistic buddies http://www.imdb.com/title/tt0488539/

Command Line Culture (CLIC)

Some people use a Command Line Interface (CLI) extensively, and like it more than a GUI. After a ten-step program, they will admit something like, "I am a command line junkie, I like it far better than pointing and clicking. I have become adicted to the bash command, and the basic linux utilities. I find myself installing the basic GNU tools on any system I use. Heck I even installed cygnus-win on my windows gaming box. Mmmm... Command completion... Tasty!"

A only somewhat more sane version of that seems to be running a GUI and a command line at the same time and switching between the two depending on what needs doing. Usually things can be done faster with the command line, but there are situations, such as doing something with multiple directories, when a GUI is more efficient.

$ cd /insanely/long/directory/path/and/you/thought/you/were/there/yet/but/no/muhhahahaaa/aaaaah

Typing that tends to waste time, even when using that yummy command completion. When doing that same thing regularly with the GUI, that may get annoying too and scripting ensues. Goodbye ten step plan. :D

Since bodies and machines are often seen in opposition, I suggest that they are better perceived complementary in nature rather than antagonistic. For people who have never worked with command line computing on a standard *nix machine, – especially for people who are already conditioned to point and click methods cultivated by GUIs such as Windows OS or Mac OS – this involves sensitising procedures, (i.e. like one may endure with any new instrumental skill acquisition) for the operation of code as a series of interrelated programs. I will discuss how using the command line interface may be seen to possibly co-constitute one another in everyday life, operating as fields of embodied reflection. [1]

A lof of commands in linux are named as an abbreviation of a word or words describing them. This makes it easier to remember them.

Getting started

Bash shells come with a very useful utility called man, short for manual files or manual pages. It gives a standardised format for documenting the purpose and usage of most of the utilities, libraries, and system calls https://www.kernel.org/doc/man-pages/. For documentation other than man pages, see the Linux Documentation Project site http://www.tldp.org/.

The manual pages are a set of pages that explain every command available on your system including what they do, the specifics of how you run them and what command line arguments they accept. They are fairly consistent in their structure so you can easily get the hang of it. Start up a console or terminal and invoke the manual pages with the following command:

$ man [command]

For example:

$ man grep
Man-grep.png

Everything is a file

Everything in linux can be viewed as a file:

  • regular files are documents, images, archives, recordings, directories (just a file containing names of other files) …
  • (character and block) device files give you access to hardware components
  • named pipes and sockets give access points for processes to communicate with each other
  • (hard and soft) links make a file accessible from different locations

With pwd (present working directory) you can see your location in the file structure.

$ pwd 
/home/user
$

With ls () you can see what is in a location:

$ ls [options] [location]

For example

$ ls -l /home/user
total 20
drwxr-xr-x 2 user user 4096 Jun 17 14:39 Desktop
drwxr-xr-x 2 user user 4096 Jul  2 00:45 Documents
drwxr-xr-x 4 user user 4096 Jul  2 00:46 Pictures

The result lines explained

  • The first character on a result line indicates whether it is a normal file (-) or a directory (d).
  • The next 9 characters are permissions for the file or directory. More on that in file permissions below.
  • A character representing the number of blocks.
  • The field following that is the owner of the file or directory (user in this case).
  • The group the file or directory belongs to (user)
  • File size
  • File modification time
  • Name of the file or directory

For more explanation on and examples of using ls do:

$ man ls

From the command line, there are many ways to create, find and list different types of files. You can determine the type of a file with the file command:

$ file privatelyinvestigating.wordpress.2015-05-02.xml 
privatelyinvestigating.wordpress.2015-05-02.xml: XML document text

Input/Output redirection

I/O redirection is one of the easiest things to master. It allows for combining different utilities effectively. For example, you may want to search through the output from nmap or tcpdump or a key-logger by feeding its output to another file or program for further analysis.

Regular expressions

Network connections

Process management (job control)

Shell scripting

Network connections

Reconnaissance

Reverse engineering

Network exploitation and monitoring

  1. Linux for Theatre Makers: Embodiment and *nix modus operandi http://networkcultures.org/blog/2007/04/23/linux-for-theatre-makers-embodiment-and-nix-modus-operandi/