Today is very much a "back to the basics" kind of day. In this article I am going to cover one of the most basic commands in Linux; the
cd command. While today's article might be basic; it is always good even for experienced sysadmins, to look back at some of the basics and see if there are ways to improve your command line skills and Linux knowledge.
The Linux/Unix directory structure
Before getting into how to change to another directory, let's take a minute to cover how Linux's directory structure is laid out. Linux's directory structure is a hierarchical directory structure, what this means is that there is a top-level or root directory and there are multiple levels of directories within the root directory. Most common Linux & Unix file systems support directories existing within other directories allowing for quite an extensive multi-level directory structure.
In Linux/Unix the root directory is symbolized by a
/ character. Any directories within the root directory can be targeted by putting
/ in front of the directories name, if we were to target the
etc directory we could do so by referencing
/etc. In addition to symbolizing the root directory the
/ character is also used to separate directories when referencing absolute paths. To continue with our
etc example if we wanted to target the
network directory inside of
etc we could do so by referencing
The cd command
When logging into a Linux shell either remotely through SSH or locally through a terminal/console, usually you will find yourself in a users home directory. While in general you can accomplish many things from this directory alone, you may find that at some point you want to move to another directory. To accomplish this we can use the
cd command, this command will change the shell processes current working directory to the directory specified.
$ cd /path/to/directory
The below example will show how to use the
cd command to change to the
$ cd /etc/network
Full Paths vs Relative Paths
The example path of
/etc/network is what is referred to as a Full Path or Absolute Path. This method of referencing a directory or file is helpful to know as it allows you to target the
network directory no matter what your current working directory is.
The alternative to referencing a directory via an Absolute Path is by referencing it with a Relative Path. A relative path is used when you reference a path based on your current working directory. For example if you were in the
/etc directory and you wanted to target the
network directory you could by simply specify
network. While this may be a little complicated to understand at first, the examples below should help clarify the difference between an absolute path and relative path.
Using the cd command
Specifying a relative path
Specifying a relative path is useful for targeting a directory that is within or near your current directory. As an example, let's say you are currently in the
/home/reader directory and you wanted to change into
/home/reader/blog you could specify the full
/home/reader/blog path or you can save yourself typing and just specify
$ pwd /home/reader $ cd blog $ pwd /home/reader/blog
In the above example I used the
pwd or Print Working Directory to print my current directory, this command is pretty helpful for finding out where you are.
Specifying an absolute path
An absolute path is helpful for referencing a directory that is not near your current directory. For example, if you were located in
/home/reader/some/other/directory and you wanted to go to
/etc it is far easier to reference it as
/etc rather than trying to use a relative path.
$ pwd /home/reader/some/other/directory $ cd /etc $ pwd /etc
In addition to the example above it is generally best to use absolute paths within scripts. Users tend to run scripts from any directory and by using absolute paths you ensure that you will be able to find any files/directories the script requires, even if it was called from an unexpected directory.
Going back a directory
In Unix & Linux shells the
. character symbolizes the current directory; Two of these characters
.. represent the directory above the current directory. You can use
.. to change to another higher level directory very quickly. This is a relative path that can reference directories above the current working directory.
$ pwd /home/reader/blog $ cd .. $ pwd /home/reader
You can also string multiple
.. characters together separated by a
/ to navigate up multiple directories.
$ pwd /home/reader/blog $ cd ../../../ $ pwd /
.. can also be used with directory names to navigate up one directory and then down other sub-directories.
$ pwd /home/reader/blog $ cd ../example $ pwd /home/reader/example
A few cd tricks
The above commands are all you really need to know to get around the Linux file system, however the below commands are some quick tricks that will help navigate the Linux file system faster.
Change to your home directory
The quickest way to change back to your home directory is to simply type
cd with no arguments.
$ pwd /var/tmp $ cd $ pwd /home/madflojo
While not providing arguments is the quickest (in terms of characters typed) another method is to specify
~ which stands for your users home directory.
$ pwd /var/tmp $ cd ~ $ pwd /home/madflojo
Change to another users home directory
~ can be used to specify another users directory as well, for example if you wanted to switch to the test users directory you can do so by specifying
$ pwd /var/tmp $ cd ~test $ pwd /home/test
The directory structure in Linux and most modern day Unix distributions follow the Filesystem Hierarchy Standard which outlines a recommended structure for common files like configuration files and binaries. If you wanted to learn about how Linux and Unix organize their file systems I suggest looking at the Filesystem Hierarchy Standard.
Originally Posted on BenCane.com: Go To Article
it creates an empty file with the name or with the required sufix and prefix. The default permissions for the file are 0600 that is read, write permission only for the creator.
The -n option is used to pass the name of the temporary file. The "-d ." indicates that the temporary file needs to be created in the current folder itself. We can pass a path to any folder in which we want the temporary folder.
Instead of a name of a file we can pass a suffix to the filename using -s
We can add a prefix using the option -p
Thus we can see that the the new file has been created with a suffix temp. But the user name is randomly chosen by the system. We can not choose the name of the file with -n option if we want to specify the suffix or prefix. If -n is passed the -s and -p, for prefix, are ignored.
The officially supported collection of software in SUSE Linux Enterprise Linux 11 Service Pack 3 does not contain all conceivable Linux software, but in the Open Build System there are tons of software that is build for SLES 11SP3. Installing these software packages and repositories is of course on your own risk, as they are not a part of the officially supported offering. In practice however it works quite well to have a officially supported SLES base and on top of that a handful of additions that you care about yourself.
Node.js on SUSE
The first colon separated part in the repository names indicate what the type of the repository is. Repos named “home:” something belong to individual users (similar to a PPA repository at Launchpad.net for those who are familiar with Ubuntu). Other names are project names, and thus more likely to have a group of maintainers and thus preferred over individual users repositories. In this case the best repository is likely to be the official devel tools subproject nodejs at “devel:languages:nodejs”.
Once the correct line is identified simply click on the “1 Click Install” link and a .ymp file will be downloaded and opened with the SUSE package manager. This .ymp file contains both the package name and repository information. If installation is executed, the repository will permanently be added to the system and the package in question installed, and in future also automatically updated. Just like PPAs in Ubuntu this repository is single-purpose and only contains a Node.js packages so no other package on the system will be affected of overridden by updates from this repository, so it is fairly safe to use. One click install also has a command line tool, so alternatively you could run:
$ OCICLI http://software.opensuse.org/ymp/devel:languages:nodejs/SLE_11_SP3/nodejs.ymp
Git and SUSE
When deploying your Node.js apps you most likely also need the Git version management software. With the same principles above you can simply install it by running:
$ OCICLI http://software.opensuse.org/ymp/devel:tools:scm/SLE_11_SP3/git.ymp
Using these same principles you can install any software from the openSUSE instance of the Open Build Service. Just browse to http://software.opensuse.org/find (often abbreviated as s.o.o) and start searching!
Renée De Voursney talking at the AU Ruby Conf about the trials and tribulations of learning Ruby.
She talks about context and how there are so many disparate moving parts to get to grips with before one can "become" part of the Ruby community. Gaining a basic understanding of all the moving parts that encompass not only the Ruby language itself, but the social norms of RSpec, Git, Gems, Github, RVM, *nix, Macs, TDD and various command line tools, is too much of a hurdle for many people to jump.
The biggest problem with a complete novice trying to get into programming is always some sort of feedback loop that will give them the justification to carry on. I'm a great believer in learning by debugging, but at the same time, giving the novice quick wins is important. Get them up and running quickly from nothing (and I mean nothing - no tools installed on their machine yet) to "hello world" in ten minutes.
It's a difficult task. People have a variety of operating systems from various flavours of Windows through Linux boxes and OSX machines. Providing a generic one-size-fits-all is nigh on impossible. Fragmentation sets in. People blog about their frustration and put up tutorials that work on their uniquely configured environments. They try to find work-arounds to annoyances like not having admin rights on computers to circumventing firewall rules that seem to get in the way of any sort of gem installation. It isn't long before someone who just wanted to take Ruby or Rails for a quick ride is hitting their head against a brick wall. And the brick wall is usually just tooling.....it isn't even the code.
Here is the script.
Save the script as matrix.sh
Give it execute permission and then execute it as follows
Pleast note that the script will not stop untill you do not press "cntrl + c" or "cntrl + z" or close the terminal.
Good Listening, Bad voltage
Myself, Stuart Langridge, Bryan Lunduke, and Jono Bacon present a new Bad Voltage, in which we discuss:
- Tech conferences — which ones are good, which ones are not, and why?
- Desktop machines versus laptops, and a review of Stuart’s new gorgeous desktop computer from PC Specialist
- Whistleblowing. In the light of the Snowden and Manning revelations, is whistleblowing a good idea, what’s available to protect whistleblowers from problems, and do we need to protect against those motivated by malice?
- Miguel de Icaza, head of Xamarin and past founder of the Gnome and Mono projects, talks about why he was singled out as a “traitor”, what he’s doing now, and how to best work in the open source world
- The winners in the Bad Voltage Selfie Competition! See the forum for more details and all the entrants
Listen to: 1×10: Midnight Throne Travels
As mentioned here, Bad Voltage is a new project I’m proud to be a part of. From the Bad Voltage site: Every two weeks Bad Voltage delivers an amusing take on technology, Open Source, politics, music, and anything else we think is interesting, as well as interviews and reviews. Do note that Bad Voltage is in no way related to LinuxQuestions.org, and unlike LQ it will be decidedly NSFW. That said, head over to the Bad Voltage website, take a listen and let us know what you think.
What makes a good website in 2014? Here are the top 8 most important priorities a business website must have to be successful and competitive today.
1. Responsive design
The share of mobile devices is growing all the time so websites are required to work on devices of all sizes. Responsive design means that the layout of a website automatically adapts to the screen dimensions. The same site works across all devices automatically and no platform specific versions needs to be developed.
In general the website must work on a broad spectrum of devices and browsers. HTML5 is the best technology (not Flash) as HTML5 is universally supported. All that is needed is a web browser, and all smart devices from phones to TVs have one.
While at it, update the design to look stunning. People have grown accustomed to ever more good looking and easy to use websites and apps.
2. Search engine optimization
The majority of visitors to a website come via search engines (mostly Google). With search engine optimization you get free search engine visibility and perhaps don’t need to buy ads. The headings and texts should describe the company using the most common terms, so that when somebody enters these terms in a search engine, the website has a chance of being in the results.
In addition to relevant content, the technical presentation must also be correct. Semantic contents mean that the human readable contents is embedded in machine readable metadata that search engines and other machines can process. For example navigation and content should be semantically separated. Images should be described in meta attributes. Prices, opening hours, addresses etc. should marked using micro formats.
3. Fast loading
The amount of mobile users (who in general have slow connections) has increased, and the speed of wired connections hasn’t significantly increased either. Having a website that loads fast is still very relevant. This is particularly demanding as websites should be ever more impressive, but the file size of big images should not grow.
Even small differences matter if there are lots of users: Amazon reports that their sales grew 1 % for each 100 milliseconds their site was optimized to load faster.
Fast pages get better higher search engine rankings. Do you want more users, who stay at your site for longer and are more return more often? Invest in speed.
4. Good web addresses
Shorter equals better: Easier to remember, easier to type on a touch screen, easier to fit in the 140 characters of a tweet…
Using the www in domains is useless. Simply example.com is enough.
Carefully choose domain names with your most important keyword embedded, as it has a big impact on search engine results.
For example for the seach ”auto” the first results are: autotrader.co.uk, autoexpress.co.uk, auto-europe.co.uk, auto-italia.co.uk, autocar.co.uk
5. Social media integration
A website needs to share content where people already are, so that the content gets visibility. Push out your contents to Facebook, Twitter, Google+ and other similar services. Visibility sparks interest to visit the website. While users visit your website, promote sharing to social networks. Two-way integration leads to a positive loop!
Also remember map services and directory services. Traditional channels still have their users: provide a RSS feed and an e-mail subscription option.
6. Visitor analytics
For most businesses the point of a website is to increase visibility among potential customers. Well, how many potential customers has there been then? Do you have statistics and analytics?
All investments into a website should be guided by the expected results (ROI). Results should be evaluated from visitor statistics. A weekly PDF report is easy to automate!
7. Easy to update
Stylishness is an important part of the visitor impression, but content in most important. At minimum the content should be correct and current. Wrong information (e.g. price, address, opening hours) on a website will make people angry and spur mistrust.
Management must always remember the website and value it as the most important communication channel.
Updating the contents should be so easy that even the CEO can do it alone, without delay or costs.
The more contents, the bigger the likelihood to be seen on somebody’s search engine results page. In social media, only new content has potential to spread, not old. Does this sound familiar: ”Sure, I’ll update as soon as I have time and can properly concentrate on it…”
There must be a dead easy tool for content management!
8. Affordable to improve
There is always something to improve. But there’s not always lots of resources? Development must be affordable, otherwise it will be infeasible to update the website to the standards of 2014. And 2015, and 2016…
The most costly things that can happen in relation to software is related to vendor lock-in. Make sure you legally actually own your contents. Remember to save documents in an open standards format and not in proprietary formats that are not future-proof. Prefer systems that are open source and avoid being a hostage of closed source software.
Break the vendor lock! Even an initially good solution will by time become just a vendor lock = monopoly = expensive. Open source software is the cure to single vendor lock-in.
See graphics in our presentations
This article is based on the presentation held in the Seravo salad lunch in January 2014. Below are the presentation slides in English and Finnish. If you live or work near Tampere, check out the schedule of our next Seravo salads!
The post Top 8 features and priorities for company websites in 2014 appeared first on Seravo.
With the explosive growth in cloud services and the pending storm of wearable devices demand for Linux skills is far out-weighing the supply resulting in great opportunities for people with Linux skills or people who wish to get Linux skills.
Explosive Growth in Demand for Linux Skills
- ReadWrite - Keep learning Linux, its the future
- ZDNet - The Linux job market heats up
- Linux.com - Linux pro work for love of Linux and cutting edge tech
Get Linux Certified
Now is the time to get skilled up in Linux to get the awesome, fulfilling, challenging and well paying job you been looking for! The Linux Professional Institute (LPI) offers an internationally recognized Linux certification that will prove to prospective employers that you have the skills they are looking for!
Get Linux Certification Training!
If you want to get on to the Linux skills ladder or looking to improve your existing skills look at LPI for fundamentals to advanced training:
- Linux Fundamentals LPIC-1 Certification Training
- Linux Intermediate LPIC-2 Certification Training,
- Linux Advanced LPIC-3 Certification Training
Contact Jumping Bean for your Linux training requirements!
Hello folks, today I thought I’d share some recent thoughts I had on the subject of shopping. You know, that thing you do when the fridge is empty. Sounds riveting doesn’t it? But stick with me. If you’re anything like me you probably hate shopping with a passion. People walking into you, pushing you out of the way, having to fight over the last decent bits of fruit and veg before they’re all gone. It’s just not fun. At least not to me. I don’t understand people who want to wander around shops all day as if it’s a pass time or a sport. It’s not, it just bloody isn’t, get a proper hobby! I guess in this regard I am 100% male. Although I don’t want to draw gender boundaries too firmly because I know plenty of women with no love for shopping either. I think it’s more of a personality thing.
The only time I will concede to enjoying this activity is going to record shops or perhaps music shops. No they’re not the same thing. Record shops are where you buy records, or more likely download mp3′s these days, showing my age there. Music shops are where you go to buy a guitar or a drum kit, or maybe a kazoo, at least in my world. I can spend hours sifting though old vinyl or tinkering with guitars and keyboards quite happily, but don’t ask me to spend hours looking at bloody clothes or other such tat. If you’ve met me you probably realised pretty quickly that I don’t much care for clothes, or at least shopping for them. They are a means to an end, they keep me warm and stop me getting arrested for public nudity. We don’t want a repeat of that incident, it totally ruined my day at Chester Zoo. The penguins have never forgiven me. Anyway, I’m going way off track now, sorry hehehe
So there I was the other day happily sat at home, when I realised I seriously needed to stock up the cupboards. It was Saturday afternoon and I knew the shops would be busy, the worst time to go <facepalm>. However, I have a pretty regular plan of attack when it comes to shopping and it goes a little like this:
- Step 1: Go through all the cupboards and the fridge to see what I need.
- Step 2: Make a comprehensive list before leaving the flat. This is essential!
- Step 3: Identify the target, in this case the shop I’m going to. Target sounds way cooler though doesn’t it?
- Step 4: Strike when they least expect, with speed and precision. Get the things I need into the basket and get to the till ASAP.
- Step 5: Get the fuck out of there and shrink back into the night!
Bosh! Job done. Now the other thing you may or may not know about me is that I’m a total comic book geek. I love Batman and it occurred to me that this is how Batman would do his shopping. Ok, so he probably gets Alfred to go but shhh now, humour me.
You see, Batman is the guy who’s thought of everything. Planned for every eventuality, down to the last detail. He’s not gonna fall for any bogus 2 for 1 offers. In any given situation he knows all the possible outcomes and how to deal with them. This is the essence of the character. If you don’t know The Dark Knight Returns (the book, not the films) do yourselves a favour and read some Frank Miller. Anyway, I’m getting sidetracked again. The upshot of all this meditation on shopping and particularly my approach to the beast, is that from now on intend to call it “Batman shopping” or perhaps “bat shopping” because, come on, who doesn’t want to be Batman? As one of my favourite podcasters Kevin Smith says “always be yourself…. unless you get the chance to be Batman, then be Batman… otherwise, be yourself”. Wise words.
So there you have it, the end of a whimsical little rant off the top of my head. Shop like Batman and you can’t go wrong. Within limits of course. Batman would probably set off a smoke bomb and drop through the ceiling before hitting the frozen food section. I’m not advocating you go that far, but give it some thought. At least look at a schematic of the shop layout before you go in, that’s just basic research.
In the end I didn’t get the shopping I deserved, but I did get the shopping I needed
So what’s your approach? Do you even have one? Do you care? Maybe you love spending hours mooching around shops, you freak. Drop me a comment if you like.
Take care out there,