Click 'Connect with Facebook' to join NetworkedBlogs. NetworkedBlogs is a community of bloggers and blog lovers. Join the fun, add your blog, and connect with others who read and write about subjects you like.
Linux - Changing Directories with the 'cd' Command
Linux – Changing Directories with ‘cd’ Command
Changing directories is likely the second most common
command in Linux aside from ‘ls’. Using the ‘cd’ command, you can change your
current working directory.
Recall the ‘pwd’ command prints your current working
directory.
Also, it is important that you understand the use of the
following,
·
‘..’- Parent directory
·
‘.’- Current directory
Linux - File Permissions and the 'chmod' Command
Linux was designed to be a multi-user operating system. So there must be a way to limit who has access to what files, and how much access.There are three sets of users in linux,User-this is an individual, such as yourself, that has login credentials to the system. Each user has their own home directory where they have full access to the files.Group-this is a set of multiple users. A group is typically created by the system admin. For instance, at a university, there could be a group setup for each course, where the professor is the group leader, and students are group members.Other-this refers to individuals that are not the u
Linux - Bash Shell Scripting - Expressions and Substrings
Expressions Sometimes in a script, you would like to evaluate an expression. For example, to find the sum of two variables. The expr command can be used to do this,$ cat testsum.sh#!/bin/bashv1=12v2=39v3=`expr $v1 + $v2`echo $v3$ ./testsum.sh$Note that the expr command must be enclosed in backquotes `…` for this to properly work. Typing man expr will display a help screen about the expr command.Substrings The expr substr command can be used to extract a substring from a string
Linux - Bash Shell Scripting - For and While Loops
Bash implements for, while, and until loops(not discussed).For Loop The basic syntax of the for loop is:for var in list; do some commandsdoneNote the semicolon; it is important to not omit it. The commands are executed once for every item in the list. The current item is accessed through the variable $var, e.g.,Use VI to edit for.sh--------------------------------for i in 1 2 3 4 5 6 7 8 9 10; do echo -n "$i "doneecho--------------------------------$ chmod 755 for.
Linux - Bash Shell Scripting - If Statements
The syntax of the if statement is,if [ conditional-expression ]; then some commandsfiorif [ conditional-expression ]; then some commandselse some other commandsfiThe character "[" actually refers to a built-in Bash command—it is a synonym for another command named test. The result of the conditional expression is 0 or nonzero with 0 being false and nonzero being true. Some examples,Use VI to edit if.sh--------------------------------today=0
Not enough data.
Calculated for blogs with 20+ followers.
- Midway to Midlife!
computers, software, technology
- El Weblog de Gerardo
software development, internet, linux
- Linucrati
Linux, Open Source, IT
- Mark LaDoux
writing, life, computers
- Brad-X
Linux, Mac, computers
Questions? contact: networkedblogs@ninua.com
Copyright (C) 2008, Ninua, Inc.