background preloader

50 UNIX / Linux Sysadmin Tutorials

50 UNIX / Linux Sysadmin Tutorials

How To Look Like A UNIX Guru Terence Parr Last updated: August 30, 2006 Translations: UNIX is an extremely popular platform for deploying server software partly because of its security and stability, but also because it has a rich set of command line and scripting tools. Programmers use these tools for manipulating the file system, processing log files, and generally automating as much as possible. If you want to be a serious server developer, you will need to have a certain facility with a number of UNIX tools; about 15. This lecture takes you through the basic commands and then shows you how to combine them in simple patterns or idioms to provide sophisticated functionality like histogramming. [By the way, this page gets a lot of attention on the net and unfortunately I get mail from lots of people that have better solutions or stuff I should add. Everything is a stream The first thing you need to know is that UNIX is based upon the idea of a stream . $ ls > /dev/null # ignore output of ls $ ls -l | grep Aug | wc -l cd

Bash Hackers Wiki Frontpage May 06, 2008 Archives | Blog of an Alpha animal There are some tools that look like you will never replace them. One of those (for me) is grep. It does what it does very well (remarks about the shortcomings of regexen in general aside). Yet, the other day I read about ack, which claims to be "better than grep, a search tool for programmers". The ack homepage lists the top ten reasons why one should use it instead of grep. It's blazingly fast because it only searches the stuff you want searched.Wait, how does it know what I want? Bottom line: yes, ack is an exciting new tool which partly replaces grep. I've written a followup on this, including some tips for day-to-day usage (and an explanation of grep's sucky performance). 'Tis well appreciated.

Jobs in 2013, a Q&A with Dice's Alice Hill The job market for Linux professionals this year is even better than it was in 2012. Ninety-three percent of hiring managers surveyed said they plan to hire at least one Linux pro in the next six months -- up from 89 percent last year, according to the 2013 Linux Jobs Report released last week by Dice and The Linux Foundation. And 75 percent of Linux pros surveyed say at least one recruiter has called them in the last six months in an effort to find talent for positions that are getting harder to fill. Alice Hill, Dice Managing Director Despite the report's encouraging statistics, though, navigating the Linux job market can still be tricky. Alice Hill: In some ways, the demand for Linux professionals mirrors what’s happening in technology right now, with companies continuing to embrace open source, cloud development and data analysis and integration. Q: How does the Linux job market compare with other tech industries? Q: DevOps is new to the survey this year.

UNIX tips: Learn 10 good UNIX usage habits Break bad UNIX usage patterns Michael StutzPublished on December 12, 2006 When you use a system often, you tend to fall into set usage patterns. Sometimes, you do not start the habit of doing things in the best possible way. Sometimes, you even pick up bad practices that lead to clutter and clumsiness. One of the best ways to correct such inadequacies is to conscientiously pick up good habits that counteract them. Adopt 10 good habits Ten good habits to adopt are: Make directory trees in a single swipe Listing 1 illustrates one of the most common bad UNIX habits around: defining directory trees one at a time. Listing 1. It is so much quicker to use the -p option to mkdir and make all parent directories along with their children in a single command. Listing 2. You can use this option to make entire complex directory trees, which are great to use inside scripts; not just simple hierarchies. Listing 3. Change the path; do not move the archive Listing 4. Listing 5. Listing 6. Listing 7.

The H: Open Source, Security and Development Ghosts of Unix Past: a historical search for design patterns October 27, 2010 This article was contributed by Neil Brown The exploration of design patterns is importantly a historical search. It is possible to tell in the present that a particular approach to design or coding works adequately in a particular situation, but to identify patterns which repeatedly work, or repeatedly fail to work, a longer term or historical perspective is needed. We benefit primarily from hindsight. The previousseries of articles on design patterns took advantage of the development history of the Linux Kernel only implicitly, looking at the patterns that could be found it the kernel at the time with little reference to how they got there. For this series we try to look for patterns which become visible only over an extended time period. Full exploitation A very appropriate starting point for this exploration is the Ritchie and Thompson paper, published in Communications of the ACM, which introduced "The Unix Time-Sharing System". File Descriptors It was hierarchical.

9 Linux podcasts you should follow There are a number of great websites that report on Linux-related news. But sometimes it's nice to listen to your news while driving to work...or playing in the background while getting some actual work done. For that, you need podcasts. But with so many out there, where do you start? This Week In Linux – A great series of short videos covering, predominantly Linux and Android specific topics, produced by Jordan Keyes. FLOSS Weekly – Part of the TWiT network, FLOSS Weekly (“Free Libre Open Source Software”) is hosted by Randal Schwartz – who is an all-around good dude – and a generally rotating crew of co-hosts. Linux Action Show – Full disclosure here. The Linux Link Tech Show – This is the granddaddy of Linux podcasts, running continuously since 2003 (almost 10 years now). Going Linux – A relaxed, amateur (I use that in the absolutely most respectful way) style podcast. Linux Outlaws – How to describe this show... Mint Cast – Like many Linux shows, the style is very laid back.

BashPitfalls - Greg's Wiki This page is a compilation of common mistakes made by bash users. Each example is flawed in some way. 1. for f in $(ls *.mp3) One of the most common mistakes BASH programmers make is to write a loop like this: for f in $(ls *.mp3); do # Wrong! some command $f # Wrong! Yes, it would be great if you could just treat the output of ls or find as a list of filenames and iterate over it. There are at least 6 problems with this: If a filename contains whitespace (or any character in the current value of $IFS), it undergoes WordSplitting. You can't simply double-quote the substitution either: for f in "$(ls *.mp3)"; do # Wrong! This causes the entire output of ls to be treated as a single word. Nor can you simply change IFS to a newline. Another variation on this theme is abusing word splitting and a for loop to (incorrectly) read lines of a file. IFS=$'\n' for line in $(cat file); do … # Wrong! This doesn't work! So, what's the right way to do it? for file in ./*.mp3; do # Better! 2. cp $file $target

zenhabits Debugging a segmentation fault using gdb « Tech Rants by Jitesh I am not a big proponent of gdb. If you *really* know what you are doing, gdb shouldn’t be required. But, every now and then, you come across code that has used function pointers exclusively and then, hand-debugging becomes painful. gdb to the rescue. You’ll need the following pre-requisites to use gdb to debug a segmentation fault: 1) make sure you have compiled the executable WITH debugging symbols. i.e. the "-g" flag. eg gcc -g -o hello hello.c Without debugging symbols, gdb won’t be able to do much. 2) Linux should core-dump on segmentation fault. Now just run that the excutable that is segfaulting. Now, we just have to tell gdb to analyze this core. eg. gdb hello core.1324 Check out the output spit out by gdb and make sure that all debugging symbols have been loaded. (gdb) bt (bt = backtrace .. prints stack strace) with this backtrace you’ll now know *exactly* where the program segfaulted. You can even analyze variable values on any frame. Like this: Like Loading...

Related: