Archive for the 'Bash and its associates' Category

I hadn’t picked up on this until today: the Bash command prompt changes depending on whether you are root or not. If you are root, it looks like # while if you are a regular user it looks becomes the $ sign. Neat.


I wanted to see if I could install some software from a repository using the command line. Fedora uses the following command:
yum install packagename
But what do you do when you don’t exactly know the package’s name, perhaps because it has something descriptive appended to the end of the filename?
Well this is what you do:
yum [...]


Pipes

10Dec07

Pipes work like redirection (discussed earlier today) except that instead of dealing with text files, we’re dealing with different programs. A pipe connects the output of one program into the input of another.
Let’s say you want to view all the files of a directory. You might type in:
ls -l
The -l bit makes the command the [...]


Input/output redirection might sound wierd, but it is actually rather useful.
Redirection, for short, is a way of taking a program on the command line and making it work with a text file. For example, to display a directory listing, we would normally type:
ls
But let’s say we wanted to keep this listing for later. We could [...]


Su and sudo

09Dec07

Depending upon who you ask, the su command stands for substitute user, switch user or super user. While being logged in as yourself, it lets you use the privileges of another user. By default, this means becoming the all-powerful ‘root’ user. For that, you simply type
su
and you will be asked for your password. To get [...]


Instructions for using particular commands can be found by simply entering:
man gawk
This gives nearly 75 screens worth of information about using the gawk command, can be rather useful. Gawk has a particularly long manual (Nano, for example, only has 11 screens, which is more more manageable). But what do you do if you wan
t something [...]


I’ve been reading about some of the command line ways to configure users and also about how the Linux filesystem works. RedHat and Fedora use a filesystem called ext3. This is a journaling filesystem (rather than ReiserFS, which was apparently used by Novell Suse Linux until last year). ext3 is a good option because it [...]


Using Vim

04Dec07

I’ve been using the Linux text editor Vim quite a lot today for updating a website. I am now at the point where I can happily modify files – navigating them, deleting lines at a time, and switching between Vim’s different modes. I googled for Page Down and found that Ctrl-F did it, which was [...]


Learning Bash

04Dec07

Three things I have just learned about Bash, the most popular “shell” or command line in Linux.
Firstly, tab completion is very handy if you want to save yourself the time of typing in a full directory name. For example, if you want to type cd Documents, to move into the Documents folder, you can simply [...]


Bash and Vim

03Dec07

I’m currently learning about two aspects of Linux: Bash, a command line interface (think DOS or the BBC Micro…) and Vim (a non-GUI text editor).
Bash I’ve used for a long time in a very basic way. It’s the default command line in Mac OS X (well, recent editions anyway) and it’s there in Fedora and [...]