![]() |
|
{Linux Tips} Paths Edition: Relative vs. Absolute Paths - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Computers (https://sinister.li/Forum-Computers) +--- Forum: Operating Systems (https://sinister.li/Forum-Operating-Systems) +--- Thread: {Linux Tips} Paths Edition: Relative vs. Absolute Paths (/Thread-Linux-Tips-Paths-Edition-Relative-vs-Absolute-Paths) |
{Linux Tips} Paths Edition: Relative vs. Absolute Paths - roger_smith - 09-09-2014 Welcome to another Linux Tips! In today's tip we're going to talk about Relative vs Absolute paths. We'll start with absolute paths. Let's say you're in a directory in the following path: Code: /home/bobby/Desktop/homework/secret/Code: cd /var/www/html/Code: cd /home/bobby/Easy right? Absolute paths are not big deal. Now we'll look at relative paths, a little more tricky. We'll say that we are in secret/ directory again (/home/bobby/Desktop/homework/secret/ in case you forgot). Now let's say you want to change to the Desktop directory using a relative path. That would look like Code: cd ../../So let's say that there is another directory in Desktop we want to look at; let's call it movies. If we wanted to go from secret to movies, we could do this: Code: cd ../../movies/There you have it, examples of absolute vs. relative path navigation, enjoy! RE: {Linux Tips} Paths Edition: Relative vs. Absolute Paths - Eclipse - 09-09-2014 Thank you for the awesome share! I was in need of this a while back when I was trying to make fa-nigga work in Firefox. RE: {Linux Tips} Paths Edition: Relative vs. Absolute Paths - Reiko - 09-09-2014 For anyone wondering "what does this have to do with hacking?" or "how can this help me hack?", look into file inclusion vulnerabilities. Roger's trying to educate everyone the proper way, and I commend him for that. However, a lot of this site's userbase are just going to skim this or disregard it if they're anything like I was when I was their age, unless they can immediately understand how it relates to their goal of being l33t h4x0rs. Again, I'm not bashing your work Roger. I actually love it. I'm just trying to appeal to the lowest common denominator here ![]() EDIT: Something that was not mentioned when dealing with paths is the special . path. It simply refers to the current directory. If you're in /var/www already and you do this: Code: cd ./htmlRE: {Linux Tips} Paths Edition: Relative vs. Absolute Paths - Oni - 09-09-2014 All very basic information, but I bet someone will find it useful. Thanks for teaching people! (09-09-2014, 09:57 AM)Reiko Wrote: For anyone wondering "what does this have to do with hacking?" or "how can this help me hack?", look into file inclusion vulnerabilities. Roger's trying to educate everyone the proper way, and I commend him for that. However, a lot of this site's userbase are just going to skim this or disregard it if they're anything like I was when I was their age, unless they can immediately understand how it relates to their goal of being l33t h4x0rs. I don't know if they will skim through it. When I first started using Linux (years ago, now) I would have loved to have seen stuff like this. Instead, I picked up the information over time. That being said, I used Linux as my primary operating system for a good amount of time, so it wasn't necessarily about hacking. It was about understanding how to use an operating system. RE: {Linux Tips} Paths Edition: Relative vs. Absolute Paths - roger_smith - 09-09-2014 thanks for all the feedback everyone. I'm going to try and do a couple of these things a week, of varying experience levels. |