2024 State of Marketing Report – by HubspotMarius Sescu
https://www.hubspot.com/state-of-marketing
· Scaling relationships and proving ROI
· Social media is the place for search, sales, and service
· Authentic influencer partnerships fuel brand growth
· The strongest connections happen via call, click, chat, and camera.
· Time saved with AI leads to more creative work
· Seeking: A single source of truth
· TLDR; Get on social, try AI, and align your systems.
· More human marketing, powered by robots
ChatGPT is a revolutionary addition to the world since its introduction in 2022. A big shift in the sector of information gathering and processing happened because of this chatbot. What is the story of ChatGPT? How is the bot responding to prompts and generating contents? Swipe through these slides prepared by Expeed Software, a web development company regarding the development and technical intricacies of ChatGPT!
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
The realm of product design is a constantly changing environment where technology and style intersect. Every year introduces fresh challenges and exciting trends that mold the future of this captivating art form. In this piece, we delve into the significant trends set to influence the look and functionality of product design in the year 2024.
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
Mental health has been in the news quite a bit lately. Dozens of U.S. states are currently suing Meta for contributing to the youth mental health crisis by inserting addictive features into their products, while the U.S. Surgeon General is touring the nation to bring awareness to the growing epidemic of loneliness and isolation. The country has endured periods of low national morale, such as in the 1970s when high inflation and the energy crisis worsened public sentiment following the Vietnam War. The current mood, however, feels different. Gallup recently reported that national mental health is at an all-time low, with few bright spots to lift spirits.
To better understand how Americans are feeling and their attitudes towards mental health in general, ThinkNow conducted a nationally representative quantitative survey of 1,500 respondents and found some interesting differences among ethnic, age and gender groups.
Technology
For example, 52% agree that technology and social media have a negative impact on mental health, but when broken out by race, 61% of Whites felt technology had a negative effect, and only 48% of Hispanics thought it did.
While technology has helped us keep in touch with friends and family in faraway places, it appears to have degraded our ability to connect in person. Staying connected online is a double-edged sword since the same news feed that brings us pictures of the grandkids and fluffy kittens also feeds us news about the wars in Israel and Ukraine, the dysfunction in Washington, the latest mass shooting and the climate crisis.
Hispanics may have a built-in defense against the isolation technology breeds, owing to their large, multigenerational households, strong social support systems, and tendency to use social media to stay connected with relatives abroad.
Age and Gender
When asked how individuals rate their mental health, men rate it higher than women by 11 percentage points, and Baby Boomers rank it highest at 83%, saying it’s good or excellent vs. 57% of Gen Z saying the same.
Gen Z spends the most amount of time on social media, so the notion that social media negatively affects mental health appears to be correlated. Unfortunately, Gen Z is also the generation that’s least comfortable discussing mental health concerns with healthcare professionals. Only 40% of them state they’re comfortable discussing their issues with a professional compared to 60% of Millennials and 65% of Boomers.
Race Affects Attitudes
As seen in previous research conducted by ThinkNow, Asian Americans lag other groups when it comes to awareness of mental health issues. Twenty-four percent of Asian Americans believe that having a mental health issue is a sign of weakness compared to the 16% average for all groups. Asians are also considerably less likely to be aware of mental health services in their communities (42% vs. 55%) and most likely to seek out information on social media (51% vs. 35%).
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
This article is all about what AI trends will emerge in the field of creative operations in 2024. All the marketers and brand builders should be aware of these trends for their further use and save themselves some time!
2024 State of Marketing Report – by HubspotMarius Sescu
https://www.hubspot.com/state-of-marketing
· Scaling relationships and proving ROI
· Social media is the place for search, sales, and service
· Authentic influencer partnerships fuel brand growth
· The strongest connections happen via call, click, chat, and camera.
· Time saved with AI leads to more creative work
· Seeking: A single source of truth
· TLDR; Get on social, try AI, and align your systems.
· More human marketing, powered by robots
ChatGPT is a revolutionary addition to the world since its introduction in 2022. A big shift in the sector of information gathering and processing happened because of this chatbot. What is the story of ChatGPT? How is the bot responding to prompts and generating contents? Swipe through these slides prepared by Expeed Software, a web development company regarding the development and technical intricacies of ChatGPT!
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
The realm of product design is a constantly changing environment where technology and style intersect. Every year introduces fresh challenges and exciting trends that mold the future of this captivating art form. In this piece, we delve into the significant trends set to influence the look and functionality of product design in the year 2024.
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
Mental health has been in the news quite a bit lately. Dozens of U.S. states are currently suing Meta for contributing to the youth mental health crisis by inserting addictive features into their products, while the U.S. Surgeon General is touring the nation to bring awareness to the growing epidemic of loneliness and isolation. The country has endured periods of low national morale, such as in the 1970s when high inflation and the energy crisis worsened public sentiment following the Vietnam War. The current mood, however, feels different. Gallup recently reported that national mental health is at an all-time low, with few bright spots to lift spirits.
To better understand how Americans are feeling and their attitudes towards mental health in general, ThinkNow conducted a nationally representative quantitative survey of 1,500 respondents and found some interesting differences among ethnic, age and gender groups.
Technology
For example, 52% agree that technology and social media have a negative impact on mental health, but when broken out by race, 61% of Whites felt technology had a negative effect, and only 48% of Hispanics thought it did.
While technology has helped us keep in touch with friends and family in faraway places, it appears to have degraded our ability to connect in person. Staying connected online is a double-edged sword since the same news feed that brings us pictures of the grandkids and fluffy kittens also feeds us news about the wars in Israel and Ukraine, the dysfunction in Washington, the latest mass shooting and the climate crisis.
Hispanics may have a built-in defense against the isolation technology breeds, owing to their large, multigenerational households, strong social support systems, and tendency to use social media to stay connected with relatives abroad.
Age and Gender
When asked how individuals rate their mental health, men rate it higher than women by 11 percentage points, and Baby Boomers rank it highest at 83%, saying it’s good or excellent vs. 57% of Gen Z saying the same.
Gen Z spends the most amount of time on social media, so the notion that social media negatively affects mental health appears to be correlated. Unfortunately, Gen Z is also the generation that’s least comfortable discussing mental health concerns with healthcare professionals. Only 40% of them state they’re comfortable discussing their issues with a professional compared to 60% of Millennials and 65% of Boomers.
Race Affects Attitudes
As seen in previous research conducted by ThinkNow, Asian Americans lag other groups when it comes to awareness of mental health issues. Twenty-four percent of Asian Americans believe that having a mental health issue is a sign of weakness compared to the 16% average for all groups. Asians are also considerably less likely to be aware of mental health services in their communities (42% vs. 55%) and most likely to seek out information on social media (51% vs. 35%).
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
This article is all about what AI trends will emerge in the field of creative operations in 2024. All the marketers and brand builders should be aware of these trends for their further use and save themselves some time!
A report by thenetworkone and Kurio.
The contributing experts and agencies are (in an alphabetical order): Sylwia Rytel, Social Media Supervisor, 180heartbeats + JUNG v MATT (PL), Sharlene Jenner, Vice President - Director of Engagement Strategy, Abelson Taylor (USA), Alex Casanovas, Digital Director, Atrevia (ES), Dora Beilin, Senior Social Strategist, Barrett Hoffher (USA), Min Seo, Campaign Director, Brand New Agency (KR), Deshé M. Gully, Associate Strategist, Day One Agency (USA), Francesca Trevisan, Strategist, Different (IT), Trevor Crossman, CX and Digital Transformation Director; Olivia Hussey, Strategic Planner; Simi Srinarula, Social Media Manager, The Hallway (AUS), James Hebbert, Managing Director, Hylink (CN / UK), Mundy Álvarez, Planning Director; Pedro Rojas, Social Media Manager; Pancho González, CCO, Inbrax (CH), Oana Oprea, Head of Digital Planning, Jam Session Agency (RO), Amy Bottrill, Social Account Director, Launch (UK), Gaby Arriaga, Founder, Leonardo1452 (MX), Shantesh S Row, Creative Director, Liwa (UAE), Rajesh Mehta, Chief Strategy Officer; Dhruv Gaur, Digital Planning Lead; Leonie Mergulhao, Account Supervisor - Social Media & PR, Medulla (IN), Aurelija Plioplytė, Head of Digital & Social, Not Perfect (LI), Daiana Khaidargaliyeva, Account Manager, Osaka Labs (UK / USA), Stefanie Söhnchen, Vice President Digital, PIABO Communications (DE), Elisabeth Winiartati, Managing Consultant, Head of Global Integrated Communications; Lydia Aprina, Account Manager, Integrated Marketing and Communications; Nita Prabowo, Account Manager, Integrated Marketing and Communications; Okhi, Web Developer, PNTR Group (ID), Kei Obusan, Insights Director; Daffi Ranandi, Insights Manager, Radarr (SG), Gautam Reghunath, Co-founder & CEO, Talented (IN), Donagh Humphreys, Head of Social and Digital Innovation, THINKHOUSE (IRE), Sarah Yim, Strategy Director, Zulu Alpha Kilo (CA).
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
The search marketing landscape is evolving rapidly with new technologies, and professionals, like you, rely on innovative paid search strategies to meet changing demands.
It’s important that you’re ready to implement new strategies in 2024.
Check this out and learn the top trends in paid search advertising that are expected to gain traction, so you can drive higher ROI more efficiently in 2024.
You’ll learn:
- The latest trends in AI and automation, and what this means for an evolving paid search ecosystem.
- New developments in privacy and data regulation.
- Emerging ad formats that are expected to make an impact next year.
Watch Sreekant Lanka from iQuanti and Irina Klein from OneMain Financial as they dive into the future of paid search and explore the trends, strategies, and technologies that will shape the search marketing landscape.
If you’re looking to assess your paid search strategy and design an industry-aligned plan for 2024, then this webinar is for you.
5 Public speaking tips from TED - Visualized summarySpeakerHub
From their humble beginnings in 1984, TED has grown into the world’s most powerful amplifier for speakers and thought-leaders to share their ideas. They have over 2,400 filmed talks (not including the 30,000+ TEDx videos) freely available online, and have hosted over 17,500 events around the world.
With over one billion views in a year, it’s no wonder that so many speakers are looking to TED for ideas on how to share their message more effectively.
The article “5 Public-Speaking Tips TED Gives Its Speakers”, by Carmine Gallo for Forbes, gives speakers five practical ways to connect with their audience, and effectively share their ideas on stage.
Whether you are gearing up to get on a TED stage yourself, or just want to master the skills that so many of their speakers possess, these tips and quotes from Chris Anderson, the TED Talks Curator, will encourage you to make the most impactful impression on your audience.
See the full article and more summaries like this on SpeakerHub here: https://speakerhub.com/blog/5-presentation-tips-ted-gives-its-speakers
See the original article on Forbes here:
http://www.forbes.com/forbes/welcome/?toURL=http://www.forbes.com/sites/carminegallo/2016/05/06/5-public-speaking-tips-ted-gives-its-speakers/&refURL=&referrer=#5c07a8221d9b
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
Everyone is in agreement that ChatGPT (and other generative AI tools) will shape the future of work. Yet there is little consensus on exactly how, when, and to what extent this technology will change our world.
Businesses that extract maximum value from ChatGPT will use it as a collaborative tool for everything from brainstorming to technical maintenance.
For individuals, now is the time to pinpoint the skills the future professional will need to thrive in the AI age.
Check out this presentation to understand what ChatGPT is, how it will shape the future of work, and how you can prepare to take advantage.
A brief introduction to DataScience with explaining of the concepts, algorithms, machine learning, supervised and unsupervised learning, clustering, statistics, data preprocessing, real-world applications etc.
It's part of a Data Science Corner Campaign where I will be discussing the fundamentals of DataScience, AIML, Statistics etc.
Time Management & Productivity - Best PracticesVit Horky
Here's my presentation on by proven best practices how to manage your work time effectively and how to improve your productivity. It includes practical tips and how to use tools such as Slack, Google Apps, Hubspot, Google Calendar, Gmail and others.
The six step guide to practical project managementMindGenius
The six step guide to practical project management
If you think managing projects is too difficult, think again.
We’ve stripped back project management processes to the
basics – to make it quicker and easier, without sacrificing
the vital ingredients for success.
“If you’re looking for some real-world guidance, then The Six Step Guide to Practical Project Management will help.”
Dr Andrew Makar, Tactical Project Management
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
During this webinar, Anand Bagmar demonstrates how AI tools such as ChatGPT can be applied to various stages of the software development life cycle (SDLC) using an eCommerce application case study. Find the on-demand recording and more info at https://applitools.info/b59
Key takeaways:
• Learn how to use ChatGPT to add AI power to your testing and test automation
• Understand the limitations of the technology and where human expertise is crucial
• Gain insight into different AI-based tools
• Adopt AI-based tools to stay relevant and optimize work for developers and testers
* ChatGPT and OpenAI belong to OpenAI, L.L.C.
More than Just Lines on a Map: Best Practices for U.S Bike Routes
This session highlights best practices and lessons learned for U.S. Bike Route System designation, as well as how and why these routes should be integrated into bicycle planning at the local and regional level.
Presenters:
Presenter: Kevin Luecke Toole Design Group
Co-Presenter: Virginia Sullivan Adventure Cycling Association
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
Has your project been caught in a storm of deadlines, clashing requirements, and the need to change course halfway through? If yes, then check out how the administration team navigated through all of this, relocating 160 people from 3 countries and opening 2 offices during the most turbulent time in the last 20 years. Belka Games’ Chief Administrative Officer, Katerina Rudko, will share universal approaches and life hacks that can help your project survive unstable periods when there seem to be too many tasks and a lack of time and people.
A report by thenetworkone and Kurio.
The contributing experts and agencies are (in an alphabetical order): Sylwia Rytel, Social Media Supervisor, 180heartbeats + JUNG v MATT (PL), Sharlene Jenner, Vice President - Director of Engagement Strategy, Abelson Taylor (USA), Alex Casanovas, Digital Director, Atrevia (ES), Dora Beilin, Senior Social Strategist, Barrett Hoffher (USA), Min Seo, Campaign Director, Brand New Agency (KR), Deshé M. Gully, Associate Strategist, Day One Agency (USA), Francesca Trevisan, Strategist, Different (IT), Trevor Crossman, CX and Digital Transformation Director; Olivia Hussey, Strategic Planner; Simi Srinarula, Social Media Manager, The Hallway (AUS), James Hebbert, Managing Director, Hylink (CN / UK), Mundy Álvarez, Planning Director; Pedro Rojas, Social Media Manager; Pancho González, CCO, Inbrax (CH), Oana Oprea, Head of Digital Planning, Jam Session Agency (RO), Amy Bottrill, Social Account Director, Launch (UK), Gaby Arriaga, Founder, Leonardo1452 (MX), Shantesh S Row, Creative Director, Liwa (UAE), Rajesh Mehta, Chief Strategy Officer; Dhruv Gaur, Digital Planning Lead; Leonie Mergulhao, Account Supervisor - Social Media & PR, Medulla (IN), Aurelija Plioplytė, Head of Digital & Social, Not Perfect (LI), Daiana Khaidargaliyeva, Account Manager, Osaka Labs (UK / USA), Stefanie Söhnchen, Vice President Digital, PIABO Communications (DE), Elisabeth Winiartati, Managing Consultant, Head of Global Integrated Communications; Lydia Aprina, Account Manager, Integrated Marketing and Communications; Nita Prabowo, Account Manager, Integrated Marketing and Communications; Okhi, Web Developer, PNTR Group (ID), Kei Obusan, Insights Director; Daffi Ranandi, Insights Manager, Radarr (SG), Gautam Reghunath, Co-founder & CEO, Talented (IN), Donagh Humphreys, Head of Social and Digital Innovation, THINKHOUSE (IRE), Sarah Yim, Strategy Director, Zulu Alpha Kilo (CA).
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
The search marketing landscape is evolving rapidly with new technologies, and professionals, like you, rely on innovative paid search strategies to meet changing demands.
It’s important that you’re ready to implement new strategies in 2024.
Check this out and learn the top trends in paid search advertising that are expected to gain traction, so you can drive higher ROI more efficiently in 2024.
You’ll learn:
- The latest trends in AI and automation, and what this means for an evolving paid search ecosystem.
- New developments in privacy and data regulation.
- Emerging ad formats that are expected to make an impact next year.
Watch Sreekant Lanka from iQuanti and Irina Klein from OneMain Financial as they dive into the future of paid search and explore the trends, strategies, and technologies that will shape the search marketing landscape.
If you’re looking to assess your paid search strategy and design an industry-aligned plan for 2024, then this webinar is for you.
5 Public speaking tips from TED - Visualized summarySpeakerHub
From their humble beginnings in 1984, TED has grown into the world’s most powerful amplifier for speakers and thought-leaders to share their ideas. They have over 2,400 filmed talks (not including the 30,000+ TEDx videos) freely available online, and have hosted over 17,500 events around the world.
With over one billion views in a year, it’s no wonder that so many speakers are looking to TED for ideas on how to share their message more effectively.
The article “5 Public-Speaking Tips TED Gives Its Speakers”, by Carmine Gallo for Forbes, gives speakers five practical ways to connect with their audience, and effectively share their ideas on stage.
Whether you are gearing up to get on a TED stage yourself, or just want to master the skills that so many of their speakers possess, these tips and quotes from Chris Anderson, the TED Talks Curator, will encourage you to make the most impactful impression on your audience.
See the full article and more summaries like this on SpeakerHub here: https://speakerhub.com/blog/5-presentation-tips-ted-gives-its-speakers
See the original article on Forbes here:
http://www.forbes.com/forbes/welcome/?toURL=http://www.forbes.com/sites/carminegallo/2016/05/06/5-public-speaking-tips-ted-gives-its-speakers/&refURL=&referrer=#5c07a8221d9b
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
Everyone is in agreement that ChatGPT (and other generative AI tools) will shape the future of work. Yet there is little consensus on exactly how, when, and to what extent this technology will change our world.
Businesses that extract maximum value from ChatGPT will use it as a collaborative tool for everything from brainstorming to technical maintenance.
For individuals, now is the time to pinpoint the skills the future professional will need to thrive in the AI age.
Check out this presentation to understand what ChatGPT is, how it will shape the future of work, and how you can prepare to take advantage.
A brief introduction to DataScience with explaining of the concepts, algorithms, machine learning, supervised and unsupervised learning, clustering, statistics, data preprocessing, real-world applications etc.
It's part of a Data Science Corner Campaign where I will be discussing the fundamentals of DataScience, AIML, Statistics etc.
Time Management & Productivity - Best PracticesVit Horky
Here's my presentation on by proven best practices how to manage your work time effectively and how to improve your productivity. It includes practical tips and how to use tools such as Slack, Google Apps, Hubspot, Google Calendar, Gmail and others.
The six step guide to practical project managementMindGenius
The six step guide to practical project management
If you think managing projects is too difficult, think again.
We’ve stripped back project management processes to the
basics – to make it quicker and easier, without sacrificing
the vital ingredients for success.
“If you’re looking for some real-world guidance, then The Six Step Guide to Practical Project Management will help.”
Dr Andrew Makar, Tactical Project Management
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
During this webinar, Anand Bagmar demonstrates how AI tools such as ChatGPT can be applied to various stages of the software development life cycle (SDLC) using an eCommerce application case study. Find the on-demand recording and more info at https://applitools.info/b59
Key takeaways:
• Learn how to use ChatGPT to add AI power to your testing and test automation
• Understand the limitations of the technology and where human expertise is crucial
• Gain insight into different AI-based tools
• Adopt AI-based tools to stay relevant and optimize work for developers and testers
* ChatGPT and OpenAI belong to OpenAI, L.L.C.
More than Just Lines on a Map: Best Practices for U.S Bike Routes
This session highlights best practices and lessons learned for U.S. Bike Route System designation, as well as how and why these routes should be integrated into bicycle planning at the local and regional level.
Presenters:
Presenter: Kevin Luecke Toole Design Group
Co-Presenter: Virginia Sullivan Adventure Cycling Association
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
Has your project been caught in a storm of deadlines, clashing requirements, and the need to change course halfway through? If yes, then check out how the administration team navigated through all of this, relocating 160 people from 3 countries and opening 2 offices during the most turbulent time in the last 20 years. Belka Games’ Chief Administrative Officer, Katerina Rudko, will share universal approaches and life hacks that can help your project survive unstable periods when there seem to be too many tasks and a lack of time and people.
14. Copyright(c) by Galaxy CD – http://www.galaxycd.com
nuucp
mail 6 root
…
3.3 Baûo veä caùc file vaø caùc thö muïc
3.3.1 Caùc quyeàn thaâm nhaäp file:
Khi file ñöôïc taïo laäp, caùc thoâng tin sau ñaây ñoàng thôøi ñöôïc ghi laïi:
- uid cuûa ngöôøi taïo file
- gid cuûa ngöôøi taïo file
- caùc quyeàn thaâm nhaäp file
…
File ñöôïc baûo veä bôûi moät taäp hôïpc caùc bit ñònh nghóa quyeàn thaâm nhaäp:
r w x r w x r w x
suid sgid
owner group other
Trong ñoù:
r quyeàn ñoïc
w quyeàn ghi
x quyeàn chaïy (executing)
suid set user-id
sgid set group-id
Ñoái vôùi thö muïc:
r quyeàn ñoïc noäi dung thö muïc
w quyeàn taïo vaø xoaù file trong thö muïc
x quyeàn qua laïi (crossing) thö muïc
Ghi chuù: caùc quyeàn vôùi thö muïc chæ coù hieäu löïc taïi moät möùc nhaát ñònh, thö muïc con coù
theå ñöôïc baûo veä trong khi thö muïc cha thì khoâng.
3.3.2 Leänh ls -l
Leänh naøy lieät keâ danh saùch caùc file vaø caùc thuoäc tính cuûa chuùng trong moät thö muïc,
qua ñoù ta coù theå phaùt hieän loaïi file, caùch baûo veä, ngöôøi sôû höõu, vaø kích thöôùc cuûa
chuùng…
Thí duï:
Caùc file thöôøng (ordinary files):
$ls -l /bin
-rwxrwxr-x 1 bin bin 16336 Mar 8 1988 cat
-rwxrwxr-x 3 root bin 16124 Mar 8 1988 cp
-rwxrwxr-x 1 bin bin 18760 Mar 8 1988 cat
-rwxrwxr-x 1 bin bin 13320 Mar 8 1988 echo
-rwxrwxr-x 2 bin bin 33896 Mar 8 1988 ed
-rwxrwxr-x 1 bin bin 28928 Mar 8 1988 file
-rwxrwxr-x 3 root bin 16124 Mar 8 1988 ln
14
15. Copyright(c) by Galaxy CD – http://www.galaxycd.com
-rwxrwxr-x 8 bin bin 60152 Mar 8 1988 ls
-rwxr-sr-x 1 bin mail 63264 April 2 1988 mail
-rwxrwxr-x 1 bin bin 15276 Mar 8 1988 mesg
-rwxr-xr-x 1 root bin 13180 Mar 8 1988 mkdir
…
Trong ñoù:
Coät 1 : loaïi file vaø quyeàn thaâm nhaäp (-rwxrwxr-x, rwxr-xr-x…)
Daáu tröø ‘-‘ ôû ñaàu coù nghóa file laø file thöôøng (khoâng phaûi thö muïc).
Daáu tröø ôû trong daõy bit coù nghóa laø khoâng coù quyeàn töông öùng bit ñoù.
Ñeå tieát kieäm choã, ngöôøi ta ñaët bit s vaøo cuøng moät nôi vôùi bit x vaø kyù hieäu:
- s neáu x toàn taïi
- S neáu X khoâng toàn taïi.
(bit s : set uid hoaëc set gid khi chaïy file)
Coät 2 : soá lieân keát (link number)
Coät 3 : teân ngöôøi sôû höõu file (owner)
Coät 4 : teân nhoùm sôû höõu file (group)
Coät 5 : kích thöôùc file.
Coät 6,7,8 : ngaøy söûa ñoåi gaàn nhaát
Coät 9 : teân file.
Caùc file ñaëc bieät (Special files):
$ll /dev
crw------- 1 lp bin 8.97 May 6 1988 lp1
crw-rw-rw- 2 root sys 3,2 Apr 3 09:08 null
brw-r----- 3 root sys 0,96 Apr 3 08:54 pd300
.
.
crw-rw-rw- 4 root sys 4,012 May 6 1988 rflop
.
.
crw--w--w- 2 root other 1,17 Mar 2 07:57 tty11
Trong ñoù:
Coät 1: Kyù töï ñaàu tieân laø c hoaëc b coù nghóa laø file ñöôïc ñoïc hoaëc ghi theo töøng
kyù töï (c) hoaëc ghi theo töøng khoái (b).
Coät 5: Bieåu dieãn majo vaø minor cuûa thieát bò (major: loaïi thieát bò, minor: ñòa chæ
cuûa thieát bò)
Caùc file thö muïc (directory files):
$ll /users
drwxr-xr-x 2 user1 stagiair 240 Mar 31 10:16 user1
15
16. Copyright(c) by Galaxy CD – http://www.galaxycd.com
drwxr-xr-x 2 user2 stagiair 32 Mar 31 11:16 user1
drwxr-xr-x 2 user3 stagiair 24 Mar 31 10:16 user1
drwxr-xr-x 2 user4 stagiair 32 Mar 31 11:16 user1
trong ñoù:
Coät 1: Kyù töï ñaàu tieân d coù nghóa laø file thö muïc.
Coät 2: Soá caùc thö muïc con
3.3.3 Thay ñoåi quyeàn thaâm nhaäp file:
Leänh chmod cho pheùp thay ñoåi quyeàn thaâm nhaäp caùc file vaø thö muïc. Coù theå chaïy leänh
theo 2 caùch:
- cho thoâng soá tuyeät ñoái:
chmod mode teân_file
trong ñoù thoâng soá mode laø moät soá cô soá 8 (octal)
r w x r - x r - -
1 1 1 1 0 1 1 0 0
7 5 4
$chmod 754 teân_file
- duøng caùc kyù hieäu töôïng tröng:
chmod who [operation] [right] filename
trong ñoù:
who : u coù nghóa user
g group
o other
a all
operation:
+ theâm quyeàn
- bôùt quyeàn
= gaùn giaù trò khaùc
right:
r reading
w writing
x execution
s ñaët suid hoaëc guid
Thí duï:
$chmod g-w, o = r toto
3.3.4 Ñaët quyeàn thaâm nhaäp ngaàm ñònh:
Caùc quyeàn thaâm nhaäp ñöôïc gaùn baèng maët naï quyeàn thaâm nhaäp cuûa töøng ngöôøi söû duïng.
Leänh umask cho pheùp ta ñaët maët naï naøy. Cuù phaùp cuûa leänh nhö sau:
umask nnn
trong ñoù: nnn laø soá buø 7 cuûa giaù trò caùc quyeàn thaâm nhaäp.
Thí duï:
$umask 177
16
17. Copyright(c) by Galaxy CD – http://www.galaxycd.com
$> titi
$ll titi
-rw------- 1 user1 other 0 Mar 11 10:11 titi
$umask 333
$>toto
$ll toto
-r--r--r-- 1 user1 other 0 Mar 11 20:11 toto
3.3.5 Thay ñoåi ngöôøi hoaëc nhoùm sôû höõu file:
Leänh chown cho pheùp thay ñoåi ngöôøi sôû höõu.
Leänh chgrp cho pheùp thay ñoåi nhoùm sôû höõu.
$echo Hello >file1
$chmod 700 file1
$ls -l file1
-rwx------ 1 user1 stagiair 6 Apr 5 14:06 file1
$cat file1
Hello
$chgrp animator file1
$ls -l file1
-rwx------ 1 user1 animator 6 Apr 5 14:06 file1
$chown user2 file1
$ls -l file1
-rwx------ 1 user2 animator 6 Apr 5 14:06 file1
$cat file1
cat: cannot open file1
Baøi taäp:
1. Haõy taïo chöông trình sau trong thö muïc tieáp nhaän:
- chöông trình “hello”:
$cat > hello
print ”Hello”
print “How are you ?”
^D
- chöông trình reply:
$cat > reply
print “Hello”
print “Fine. And you ?”
^D
2. Xem quyeàn thaâm nhaäp vaøo caùc file treân:
ll -R
3. Chaïy 2 chöông trình treân.
17
22. Copyright(c) by Galaxy CD – http://www.galaxycd.com
$ls -l appli
total 1
-rw-rw-r-- 2 user2 stagiair 71 Apr 5 17:05 file1
$ls -l file.link
total 1
-rw-rw-r-- 2 user2 stagiair 71 Apr 5 17:05 file.link
4.4 Tìm kieám moät file
Leänh find cho pheùp tìm moät hay nhieàu file trong caây thö muïc. Ta coù theå:
- Tìm theo teân:
$find ñöôøng_daãn -name teân_file -print
- Tìm theo soá i-node (i-num) cuûa file:
$find ñöôøng_daãn -inum number -print
- Tìm theo teân ngöôøi sôû höõu:
$find pathname -user username -print
Ñeå traùnh caùc thoâng baùo loãi ñöa ra maøn hình, ta coù theå ñoåi höôùng ñaàu ra loãi chuaån
(standard error) tôùi moät file khoâng (/dev/null)
$find / -name filename -print 2> /dev/null
Thí duï:
$pwd
/users/user1
$find / -name ttyc2d1 -print 2> /dev/null
/dev/ttyc2d1
$ls -i /unix
2810 -r-xr--r-- 2 bin bin 508516 Mar 10 1989 /unix
$find / -inum 2810 -print 2> /dev/null
/unix
/makesys/root/unix
$pwd
/users/user1
$find /users -user -user1 -print
/users/user1
/users/user1/res1
/users/user1/res
22
23. Copyright(c) by Galaxy CD – http://www.galaxycd.com
/users/user1/file1
$ll
total 3
-rw-rw-r-- 1 user1 stagiair 75 Oct 18 11:41 res1
-rw-rw-r-- 1 user1 stagiair 75 Oct 18 11:42 res
-rw-rw-r-- 1 user1 stagiair 75 Oct 18 11:43 file1
Baøi taäp:
1. Taïo 2 files file1 vaø file2 trong thö muïc tieáp nhaän.
2. Sao caùc file ñoù vaøo caùc file file?.old
cp file1 file1.old
3. Taïo caùc thö muïc src vaø bin
mkdir src bin
4. Sao caùc file file1 vaø file2 vaøo thö muïc src, caùc file file?.old vaøo thö muïc bin.
5. Xoaù caùc file trong thö muïc tieáp nhaän.
6. Sao caùc files file1, file2, file1.old vaø file2.old trôû laïi thö muïc tieáp nhaän.
7. Ñeå laøm tieáp caùc phaàn sau, caàn toå chöùc caùc file nhö sau:
- file1 vaø file2 ôû trong thö muïc bin
- file1.old vaø file2.old ôû trong thö muïc src vaø
- khoâng coù file naøo ôû trong thö muïc tieáp nhaän.
Taïo moät lieân keát teân laø file3 trong thö muïc tieáp nhaän vôùi file1 trong thö muïc bin
cd
ln /users/userX/bin/file1 /users/userX/file3
8. Lieät keâ 2 file file1 vaø file3
ll -i /users/userX/bin/file1 /users/userX/file3
Ta coù nhaän xeùt gì veà nhöõng thoâng tin ñöôïc ñöa ra maøn hình ?
9. Haõy xoaù file3 vaø kieåm tra xem noù ñaõ bò xoaù chöa, xem ñieàu gì xaûy ra vôùi file1?
Haõy giaûi thích.
10. Leänh chuyeån file (mv) cho pheùp ñoåi teân moät file. Haõy sao file file2.old trong
thö muïc src vaøo file file4/
11. Haõy tìm file vi
find / -name vi -print 2> /dev/null
12. Xem giaù trò i-num cuûa file vi (duøng ll vôùi tuyø choïn –l)
13. Tìm taát caû caùc file coù cuøng giaù trò i-num vôùi vi.
23
24. Copyright(c) by Galaxy CD – http://www.galaxycd.com
Baøi 5: Thoâng tin giöõa nhöõng ngöôøi söû duïng
Noäi dung: giôùi thieäu caùc leänh duøng ñeå truyeàn vaø nhaän tin mail, write
5.1 Thoâng tin baèng leänh mail
5.1.1 Gôûi thö
Leänh mail cho pheùp gôûi thö cho ngöôøi khaùc. Vieäc gôûi khoâng phuï thuoäc vaøo ngöôøi nhaän
ñang trong phieân laøm vieäc hay khoâng.
$mail user1
message written-out
Ctrl-D
$
5.1.2 Nhaän thö:
Khi baét ñaàu phieân laøm vieäc, neáu ta coù thö, treân maøn hình seõ hieän doøng thoâng baùo “you
have mail”. Trong quaù trình laøm vieäc, SHELL seõ laøm coâng vieäc kieåm tra thö ñeán theo
moät chu kyø thôøi gian ñònh tröôùc. Ñeå xem hoäp thö, ta duøng leänh mail khoâng coù ñoái.
Thí duï:
- gôûi thö cho ngöôøi khaùc:
$whoami
user2
$mail user3
you can read my files
CTRL-D
$
- nhaän thö
bmw
Welcom on DPX/2
login : user3
B.O.S
you have mail
$mail
From user2 Fri Mar 7 12:07 EET 1992
you can read my files
?h
usage
q quit
x exit without changing mail
24
25. Copyright(c) by Galaxy CD – http://www.galaxycd.com
p print
s [file] save (default mailbox)
w [file] same without header
- print previous
d delete
+ [user] mail to user
!cmd execute cmd
?q
$
Chuù yù: Ñaàu thö (header) coù theå bò thay ñoåi khi laøm vieäc treân maïng.
5.3 Thoâng tin baèng leänh write
Leänh write cho pheùp gôûi thoâng baùo töùc thôøi tôùi nhöõng ngöôøi khaùc ñang trong phieân laøm
vieäc.
$write user2
hello my friend
how are you
CTRL – D
$
Leänh wall cho pheùp gôûi thoâng baùo tôùi taát caû nhöõng ngöôøi ñang laøm vieäc trong heä.
Leänh write ghi thoâng tin tröïc tieáp leân maøn hình neân coù theå gaây nhieãu cho coâng vieäc maø
ngöôøi nhaän ñang laøm. Ñeå traùnh laøm vieäc ñoù coù theå duøng leänh mesg vôùi tuyø choïn n.
$mesg
…
25
26. Copyright(c) by Galaxy CD – http://www.galaxycd.com
Baøi 6: Söû duïng chöông trình soaïn thaûo vi möùc cô sôû
Noäi dung: giôùi thieäu chöông trình soaïn thaûo vi, cung caáp moät soá kieán thöùc cô sôû ñeå coù
theå soaïn thaûo ñöôïc vaên baûn hay chöông trình.
6.1 Khôûi ñoäng vi
6.1.1 Giôùi thieäu chung:
vi (vieát taét cuûa Video Interactif) laø chöông trình soaïn thaûo vaên baûn theo trang maøn
hình:
- Maøn hình ñöôïc xem nhö moät cöûa soå môû treân file.
- Coù khaû naêng di chuyeån cursor tôùi baát kyø nôi naøo treân maøn hình.
- Cöûa soå coù theå di chuyeån töï do treân file.
Ñeå hieån thò ñuùng, vi caàn bieát kieåu terminal ñang duøng.
Ta coù theå ñònh nghóa ñöôïc kieåu terminal baèng caùch gaùn gía trò cho bieán moâi tröôøng
TERM:
Thí duï:
$TERM=tws2103;export TERM
Phaàn lôùn caùc phím ñöôïc duøng ñoäc laäp hoaëc keát hôïp vôùi phím SHIFT vaø CTRL ñeå taïo
caùc leänh cuûa vi.
Khi moät leänh bò goõ sai, vi baùo hieäu baèng nhaùy maøn hình, keâu beep hoaëc thoâng baùo loãi.
Chöông trình vi ñöôïc xaây döïng töø chöông trình soaïn thaûo doøng ex. Caùc leänh cuûa ex coù
theå ñöôïc goïi khi coù daáu “:” ôû doøng cuoái maøn hình.
6.1.2 Baét ñaàu duøng vi
Ta coù theå goïi vi vôùi teân file vaên baûn:
$vi teân_file
Cöûa soå soaïn thaûo seõ ñöôïc môû taïi ñaàu file. Neáu file chöa toàn taïi, noù seõ ñöôïc taïo bôûi leänh
ghi. Doøng cuoái cuøng treân maøn hình ñöôïc duøng cho nhöõng vieäc sau:
- vaøo caùc leänh,
- thoáng keâ,
- baùo loãi.
Ñoái vôùi nhöõng ngöôøi môùi duøng vi, coù theå duøng version khaùc cuûa vi:
$vedit teân_file
version naøy cuûa vi seõ hieän thoâng baùo INPUT MODE khi ta ñang trong cheá ñoä nhaäp vaên
baûn.
Khi ta chæ muoán xem noäi dung cuûa moät file, duøng:
$view teân_file.
version naøy cuûa vi môû file chæ ñeå ñoïc, cho pheùp ta xem ñöôïc noäi dung maø traùnh ñöôïc
nguy cô file bò thay ñoåi.
26
27. Copyright(c) by Galaxy CD – http://www.galaxycd.com
6.1.2 Ra khoûi vi:
Muoán ra khoûi vi vaø ghi file coù theå duøng moät trong caùc caùch sau:
ZZ hoaëc
:w sau ñoù :q hoaëc
:wq hoaëc
:x
Ra khoûi vi vaø khoâng ghi file:
:q (neáu khoâng coù söûa ñoåi) hoaëc
:q!
Khi ñang trong vi, muoán laøm vieäc vôùi SHELL, ta coù theå laøm nhö sau:
- chaïy moät leänh cuûa SHELL
:!leänh
- hoaëc goïi SHELL, sau ñoù chaïy caùc leänh ta muoán, khi keát thuùc aán CTRL-D ñeå trôû
laïi vi:
:!sh
$leänh
$CTRL-D
6.2 Soaïn thaûo vaên baûn:
6.2.1 Xen vaên baûn:
- xen kyù töï treân moät doøng:
a <text> <ESC> Xen kyù töï vaøo sau cursor. Leänh khoâng
ñöôïc hieån thò treân maøn hình. ESC: Keát thuùc
cheá ñoä xem.
i <text> <ESC> Xen kyù töï vaøo tröôùc cursor.
A <text> <ESC> Xen kyù töï vaøo cuoái doøng.
I <text> <ESC> Xen kyù töï vaøo ñaàu doøng.
- xen doøng:
o <text> <ESC> Xen moät doøng vaøo tröôùc doøng chöùa cursor.
O <text> <ESC> Xen moät doøng vaøo sau doøng chöùa cursor.
Ghi chuù: muoán xen caùc kyù töï khoâng in ñöôïc (non printable) ta phaûi goõ:
CTRL – V tröôùc chuùng.
6.2.2 Di chuyeån cursor trong file:
- theo kyù töï:
sang traùi: duøng phím muõi teân traùi hoaëc h hoaëc backspace.
xuoáng doøng: duøng phím muõi teân xuoáng hoaëc j hoaëc linefeed
sang phaûi : duøng phím muõi teân phaûi hoaëc i hoaëc escape.
leân doøng : duøng phím muõi teân leân hoaëc k.
- theo doøng:
^ veà ñaàu doøng
$ cuoái doøng
27
28. Copyright(c) by Galaxy CD – http://www.galaxycd.com
Enter ñaàu doøng tieáp
- ñaàu doøng treân
0(null) veà ñaàu doøng vaät lyù (doøng baét ñaàu baèng daáu caùch hoaëc tab)
- theo maøn hình:
H veà ñaàu maøn hình (Home)
M veà giöõa maøn hình (Middle)
L veà cuoái maøn hình (Last)
- theo töø (word):
w W veà ñaàu töø tieáp
b B ñaàu töø hieän taïi
e E cuoái töø hieän taïi
- theo caâu (sentence):
( veà ñaàu caâu
) veà cuoái caâu
daáu keát thuùc moät caâu laø caùc daáu ., ! hoaëc ?
- theo ñoaïn vaên (paragraph):
{ veà ñaàu ñoaïn vaên
} cuoái ñoaïn vaên
ñoaïn vaên keát thuùc baèng moät doøng troáng.
- theo cöûa soå (window):
z doøng hieän taïi ôû giöõa cöûa soå.
z<Enter> doøng hieän taïi ôû ñaàu cöûa soå.
z- doøng hieän taïi ôû cuoái cöûa soå.
^D xuoáng nöûa cöûa soå
^U leân nöûa cöûa soå
^F xuoáng moät cöûa soå (-2 doøng)
^B leân moät cöûa soå (2 doøng)
Ghi chuù: ^ laø kyù hieäu cuûa phím CTRL
- theo soá thöù töï doøng:
Ñeå hieån thò soá thöù töï cuûa caùc doøng soaïn thaûo:
:set nu
Xoaù boû hieån thò treân:
:set nonu
:n <Enter> hoaëc nG chuyeån cursor ñeán doøng thöù n
:$ hoaëc G ñeán doøng cuoái vaên baûn
:se list hieån thò caùc kyù töï aån (hidden)
28
29. Copyright(c) by Galaxy CD – http://www.galaxycd.com
- tìm daõy kyù töï:
/ kyù hieäu chieàu tìm xuoâi.
? kyù hieäu chieàu tìm ngöôïc.
/string chuyeån cursor tôùi doøng chöùa daõy kyù töï theo chieàu xuoâi.
?string chuyeån cursor tôùi doøng chöùa daõy kyù töï theo chieàu ngöôïc.
// laëp laïi tìm xuoâi.
?? laëp laïi tìm ngöôïc.
6.2.3 Xoùa vaên baûn:
- xoùa kyù töï:
x xoùa kyù töï taïi vò trí cursor
3x xoùa 3 kyù töï
X xoùa kyù töï tröôùc vò trí cursor
- xoùa doøng vaên baûn:
dd hoaëc :d<CR> xoùa doøng chöùa cursor
3dd xoùa 3 doøng baét ñaàu töø doøng chöùa cursor
d$ hoaëc D xoùa ñeán cuoái doøng
dw xoaù töø chöùa cursor
3dw hoaëc d3w xoaù 3 töø
d/string xoùa khi heát daõy string
6.2.4 Thay theá vaên baûn:
- thay theá kyù töï:
rc thay theá kyù töï hieän taïi baèng kyù töï c (???)
R<text><ESC> thay theá soá kyù töï baèng daõy “text”
- thay theá doøng:
S<text><ESC> xoùa doøng hieän taïi vaø thay noù baèng “text”
- thay theá töø:
cw<text><ESC> thay moät töø baèng “text”. Töø ñöôïc thay theá tính töø cursor
ñeán kyù töï $.
c2w<text><ESC> thay 2 töø.
C hoaëc c$ thay theá cuoái doøng
c/string thay theá ñeán heát ”string”
6.2.5 Xoùa hoaëc laëp laïi leänh:
- Xoaù leänh
u xoùa taùc duïng cuûa leänh cuoái cuøng
29
30. Copyright(c) by Galaxy CD – http://www.galaxycd.com
U xoaù taát caû thay ñoåi ñaõ laøm treân doøng hieän taïi.
- Laëp laïi leänh:
. laëp laïi leänh söûa ñoåi vaên baûn cuoái cuøng (???)
6.2.6 Xem traïng thaùi vaên baûn ñang soaïn thaûo:
^G Hieån thò teân, traïng thaùi, soá doøng, vò trí ,cursor vaø phaàn traêm vaên baûn tính töø vò
trí cursor ñeán cuoái vaên baûn.
6.2.7 Sao cheùp, chuyeån vaên baûn:
- di chuyeån vaên baûn:
Moãi laàn thöïc hieän moät leänh xoùa (x hoaëc d), vi ñeàu ghi laïi phaàn vaên baûn bò xoùa vaøo
vuøng ñeäm rieâng cho ñeán laàn xoùa sau. Leänh p vaø P cho pheùp laáy laïi vaên baûn töø vuøng
ñeäm ñoù. Tröôùc khi thöïc hieän leänh naøy, cursor phaûi ñöôïc ñaët vaøo vò trí cuøng kieåu vôùi
phaàn vaên baûn coù trong vuøng ñeäm :
-kyù töï
-töø
-doøng
-cuoái doøng (end of line)
p sao phaàn vaên baûn xoaù laàn cuoái cuøng vaøo sau ñoái töôïng trong cuøng kieåu.
P sao phaàn vaên baûn xoaù laàn cuoái vaøo tröôùc ñoái töôïng cuøng kieåu.
Moät caùch khaùc ñeå chuyeån doøng:
:5,10m20 chuyeån caùc doøng töø 5 ñeán 10 tôùi sau doøng 20
- Sao cheùp vaên baûn:
Leänh y(yank) cho pheùp sao phaàn vaên baûn ta muoán vaøo vuøng ñeäm . Muoán sao phaàn
vaên baûn töø vuøng ñeäm ra, ta phaûi chuyeån cursor vaøo nôi caàn sao, sau ñoù duøng p hoaëc
P.
Y3w sao 3 töø vaøo vuøng ñeäm
Y hoaëc yy sao doøng hieän taïi vaøo vuøng ñeäm .
5yy sao 5 doøng vaøo vuøng ñeäm
Moät caùch khaùc ñeå sao cheùp doøng:
:5,8t25 sao caùc doøng töø 5 ñeán 8 tôùi sau doøng 25
6.3 Duøng vi vôùi danh saùch caùc leänh ñaõ chaïy cuûa Shell (history of commands)
Leänh fc (fix command) cho pheùp ta soaïn thaûo baèng vi vaø chaïy laïi caùc leänh ñaõ chaïy cuûa
Shell, caùch duøng nhö sau:
- soaïn thaûo vaø cho chaïy leänh cuoái cuøng:
$fc
- soaïn thaûo moät nhoùm leänh vaø cho chaïy:
$fc m n
- xem danh saùch 16 leänh cuoái cuøng:
$fc -l hoaëc history
30
32. Copyright(c) by Galaxy CD – http://www.galaxycd.com
Chuyeån cursor tôùi kyù töï “D” cuûa “Dupont”:
hoaëc:
XxxxxxiMartin<ESC> (duøng x ñeå xoùa kyù töï)
(neáu laøm sai hoaëc muoán laøm laïi goõ U ñeå xoaù boû toaøn boä thay ñoåi treân doøng)
hoaëc:
dwiMartin<ESC> (duøng dw ñeå xoùa töø)
hoaëc:
cwMartin<ESC> (duøng cw ñeå thay töø)
10. Xoaù doøng chöùa “Coteau Jean”:
/Couteau Jean/
dd
11. Thay taát caû “Dupont” thaønh “Durand”
/Dupont/
cwDurand<ESC>
//
.
12. Chuyeån caùc doøng chöùa “Durand” xuoáng cuoái vaên baûn:
Chuyeån cursor tôùi doøng “Durand” ñaàu tieân:
4dd (xoùa 4 doøng vaø ñöa vaøo vuøng ñeäm)
G (chuyeån ñeán cuoái vaên baûn)
P (sao töø trong vuøng ñeäm )
13. Nhaân ñoâi doøng chöùa “Martin Jean”
yy
p
14. Hieän ta ñang trong vi, haõy gôûi thoâng baùo tôùi cho ngöôøi khaùc ñang trong phieân
laøm vieäc:
:!who
:!mail userX
message
^D
15. Ta ñang ôû taïi thö muïc tieáp nhaän, söûa ñoåi vaø chaïy laïi moät leänh:
$cd
$write userX
message
^D
$fc ->söûa X thaønh Y
:wq
$
32
33. Copyright(c) by Galaxy CD – http://www.galaxycd.com
Baøi 7 Shell_script
Noäi dung: giôùi thieäu shell, tieán trình (process) vaø caùc caùch thöùc thöïc hieän tieán trình.
Shell coù theå ñoïc vaø thöïc hieän moät file goàm danh saùch caùc leänh caàn thöïc hieän.
File ôû daïng naøy ñöôïc goïi laø shell_sript hoaëc procedure
Shell_script ñöôïc thöïc hieän nhôø shell, vaø chính shell seõ phaùt sinh vaø quaûn lyù taát caû caùc
tieán trình caàn thieát ñeå thöïc hieän coâng vieäc ñöôïc moâ taû trong shell_script
7.1 Quaûn lyù tieán trình:
7.1.1 Muïc ñích cuûa shell
Shell laø chöông trình thoâng dòch leänh
Hieån thò $
Ñoïc leänh
Taïo tieán trình
Ñôïi tieán trình keát thuùc
Hieån thò $
7.1.2 Taïo tieán trình:
Khaùi nieäm chung veà tieán trình:
Tieán trình ñöôïc hieåu laø vieäc thöïc hieän moät coâng vieäc hay moät chöông trình trong moâi
tröôøng cuï theå trong heä thoùng. Ta coù theå phaân bieät hai loaïi tieán trình:
- Tieán trình heä thoáng: laø tieán trình khoâng gaén vôùi baát kyø moät terminal naøo, noù
ñöôïc taïo ra vaøo thôøi ñieåm khôûi ñoäng heä thoáng hoaëc vaøo caùc thôøi ñieåm coá ñònh
do ngöôøi duøng quaûn trò heä thoáng ñaët.
33
34. Copyright(c) by Galaxy CD – http://www.galaxycd.com
- Tieán trình do ngöôøi söû duïng taïo ra.
Caùc tieán trình ñöôïc toå chöùc theo daïng caây:
Tieán trình cha tieán trình con
(parent) (child)
Ñoái vôùi ngöôøi söû duïng, tieán trình cha laø Shell ñöôïc taïo taïi thôøi ñieåm baét ñaàu phieân laøm
vieäc.
7.1.3 Lieät keâ caùc tieán trình:
Leänh ps cho pheùp lieät keâ danh saùch caùc tieán trình ñang dieãn ra:
$ps -f
UID PID PPID C STIME TTY TIME COMMAND
user5 4582 1 0 11:04:45 tty23 0:01 -sh
user5 4792 4582 36 11:10:04 tty23 0:04 ps -f
trong ñoù:
UID soá UID cuûa ngöôøi chuû tieán trình
PID soá cuûa tieán trình (process identity)
PPID soá cuûa tieán trình cha (parent process identity)
C chæ soá söû duïng boä xöû lyù (processor utilization for scheduling).
STIME thôøi ñieåm baét ñaàu tieán trình
TTY terminal ñieàu khieån tieán trình
TIME thôøi gian tích luyõ thöïc hieän tieán trình (cumulative time)
COMMAND teân leänh sinh ra tieán trình
Tieán trình soá 1 laø tieán trình init, trong ñoù coù chöùcc naêng giaùm saùt caùc terminal, laø tieán
trình cha cuûa taát caû caùc tieán trình Shell khi login.
Caùch thöïc hieän moät shell_script:
$chmod +x proc
$proc
hoaëc
$sh proc
7.2 Laäp caùch thöùc (setup) cho shell_script:
Leänh set cho pheùp laäp caùch thöùc chaïy shell_script.
set -x hieån thò doøng leänh sau khi trieån khai leänh
set -v hieån thò doøng leänh tröôùc khi trieån khai
set -e ra khoûi shell_script sau khi gaëp moät loãi
set -t ra khoûi shell_script sau leänh tieáp
set - xoaù taùc duïng cuûa x vaø v
Vieäc laäp caùch thöùc chæ lieân quan tôùi shell_script ñang chaïy. Caùc tuyø choïn -x vaø –v coù
theå ñöa vaøo doøng leänh goïi shell_script:
$sh -v proc
34
35. Copyright(c) by Galaxy CD – http://www.galaxycd.com
$sh -x proc
Thí duï:
- duøng “-x”:
$cat exam1
set -x
echo “The current directory is :”
pwd
echo “List of files :“
echo file1 file2 file3
$exam1
+ echo The current directory is :
The current directory is:
+ pwd
/users/user8
+ echo List of files:
List of files:
+ echo file1 file2 file3
file1 file2 file3
- duøng “-v”:
$cat exam2
set -v
echo “The current directory is :”
pwd
echo “List of files :“
echo file1 file2 file3
$exam2
echo The current directory is :
The current directory is:
pwd
/users/user8
echo List of files:
List of files:
echo file1 file2 file3
file1 file2 file3
Coù theå duøng kyù töï ‘#’ ñeå vieát chuù thích cho doøng leänh trong shell_script, neáu chuù thích
vieát ngay sau leänh treân cuøng moät doøng, ta phaûi cho ít nhaát moät daáu caùch (space) vaøo
tröôùc kyù töï ‘#’.
35
36. Copyright(c) by Galaxy CD – http://www.galaxycd.com
7.2 Caùc loaïi Shell UNIX
Coù 3 loaïi shell UNIX:
csh cuûa Berkeley BSD
sh cuûa AT&T, Bourne-shell
ksh cuûa AT&T,Korn-shell
Shell ksh duøng trong taøi lieäu naøy laø toaøn boä sh keát hôïp vôùi phaàn phaùt trieån cuûa csh.
Shell csh coù cuù phaùp gioáng ngoân ngöõ C, nhöng caùc shell_script cuûa csh khoâng chaïy
ñöôïc döôùi sh vaø ksh.
Döôùi ñaây laø lieät keâ nhöõng khaùc nhau cô baûn khaùc:
- csh vaø ksh coù nhaät kyù (history).
- ksh coù trình soaïn thaûo doøng (line editor)
- cuù phaùp voøng laëp
csh: while end
ksh, sh: while do done
- chæ csh coù leänh goto
- cô cheá thay theá bieán cuûa ksh laø hoaøn thieän nhaát
- csh vaø ksh coù caùc pheùp tính soá hoïc.
36
38. Copyright(c) by Galaxy CD – http://www.galaxycd.com
maø leänh naøy caàn ñoïc
STRING
$
Thí duï: duøng leänh cat taïo moät file:
$cat > file1 <<OK
aa
bb
OK
$cat file1
aa
bb
$
8.2 Chuyeån döõ lieäu giöõa caùc tieán trình:
Hai doøng leänh sau ñaây:
leänh1 > temp
leänh2 < temp
coù theå ñöôïc thay theá baèng moät doøng leänh nhö sau:
leänh1 | leänh 2
Khi ñoù ñaàu ra chuaån cuûa leänh leänh1 seõ laø ñaàu vaøo chuaån cuûa leänh leänh2, vaø file trung
gian temp khoâng caàn thieát nöõa.
Kyù hieäu | goïi laø oáng (pipe).
Thí duï:
$ls -l | pg
8.3 Ñoåi höôùng keùp (double) ñaàu ra chuaån:
Leänh tee cho pheùp ñoåi höôùng keùp ñaàu ra chuaån: vöøa höôùng döõ lieäu ñaàu ra veà höôùng
khaùc, vöøa hieån thò ra maøn hình.
$leänh | tee teân_file.
stdout
leänh tee stdout
teân_file
38
39. Copyright(c) by Galaxy CD – http://www.galaxycd.com
Thí duï:
$ps -ef | tee file_ps | grep $LOGNAME
Coù theå duøng tee vôùi tuyø choïn –a (tee –a), khi ñoù döõ lieäu ñaàu ra seõ ñöôïc ghi tieáp vaøo
cuoái file file_ps
Baøi taäp:
1. Haõy vieát leänh coù teân WHO vôùi caùc chöùc naêng sau::
- tính vaø hieån thò soá ngöôøi söû duïng ñang trong phieân laøm vieäc.
- hieån thò danh saùch vaø caùc thuoäc tính cuûa hoï.
- xoùa file ñeäm (neáu coù duøng) ñöôïc taïo khi chaïy leänh WHO.
Gôïi yù: duøng caùc leänh who, tee, wc.
2. Vieát leänh LLD lieät keâ caùc thö muïc con trong moät thö muïc.
Gôïi yù: duøng caùc leänh ll vaø grep.
39
40. Copyright(c) by Galaxy CD – http://www.galaxycd.com
Baøi 9: Cô cheá thay theá cuûa Shell
Noäi dung: caùch thao taùc vôùi caùc tham soá cuûa shell_script, caùc bieán trong Shell, caùc kyù
töï ñaëc bieät ñöôïc thoâng dòch khi vieát trong caâu leänh shell.
9.1 Truyeàn tham soá:
9.1.1 Truyeàn tham soá cho moät Shell_script
Moät Shell_script coù theå laøm vieäc vôùi caùc thoâng soá ñöôïc truyeàn qua doøng leänh.
$proc par1 par2 par3
| | | |
$0 $1 $2 $3
Trong Shell_script ñöôïc goïi (trong tröôøng hôïp naøy laø proc), caùc tham soá ñöôïc theå hieän
baèng:
$0 teân Shell_script
$1 tham soá thöù nhaát
$2 tham soá thöù hai
$n tham soá thöù n
$# soá caùc tham soá
$* taát caû caùc tham soá
$$ PID cuûa shell_script
Thí duï:
$cat param
echo Name of shell_script: $0
echo First parameter : $1
echo Third parameter : $3
echo Number of parameters: $#
echo List of all the param: $*
$
$param London Paris New-York Brussels
Name of shell_script: param
First parameter: London
Third parameter: New-York
Number of parameters: 4
List of all the param: London Paris New-York Brussels
9.1.2 Dòch chuyeån caùc tham soá:
40
41. Copyright(c) by Galaxy CD – http://www.galaxycd.com
Vôùi caùch theå hieän tham soá cuûa shell_script baèng $n, ta chæ coù theå laøm vieäc ñöôïc vôùi töø
1 ñeán 9 tham soá. Baèng caùch dòch chuyeån, ta coù theå laøm vieäc vôùi soá tham soá nhieàu hôn
9. Vieäc dòch chuyeån ñöôïc thöïc hieän bôûi leänh:
shift
Sau khi shift:
- $0 vaãn giöõ nguyeân
- $1 maát ñi
- $2 thaønh $1
- $3 thaønh $2
- $n thaønh $n-1
- $*, S# ñöôïc caäp nhaät laïi.
Coù theå dòch chuyeån n vò trí baèng caùch:
shift n
Thí duï:
$cat shifting
echo First parameter: $1
echo Nineth parameter: $9
echo Number of parameters: $#
echo “SHIFTING”
shift
echo First parameter: $1
echo Nineth parameter: $9
echo Number of parameters: $#
$
$shifting A B C D E F G H I J K
First parameter: A
Nineth parameter: I
Number of parameters: 11
“SHIFTING”
shift
First parameter: B
Nineth parameter: J
Number of parameters: 10
$
9.2 Caùc bieán Shell
9.2.1 Caùc kieåu bieán:
Ksh coù theå xöû lyù 4 kieåu bieán sau:
- soá nguyeân
- xaâu kyù töï
41
53. Copyright(c) by Galaxy CD – http://www.galaxycd.com
- file1 vaø file2 toàn taïi vaø chæ ñoïc ñöôïc
vaø
- file 3 toàn taïi vaø ghi ñöôïc.
11.2 Laäp trình moät caáu truùc coù ñieàu kieän:
11.2.1 Caáu truùc coù ñieàu kieän :
a) if then else fi
if command1
then command2
else command3
fi
Giaûi thích:
Neáu giaù trò traû veà sau khi thöïc hieän command1 laø 0 (ñuùng) thì thöïc hieän
command2,
neáu khoâng thì thöïc hieän command3
keát thuùc
Thí duï:
if test -f file1
then echo “file exists”
else echo “file does not exist”
fi
Chuù thích: khoâng baét buoäc phaûi duøng else
if [-w file1]
then echo “message” >> file1
fi
b) Caáu truùc loàng (nested)
Ta coù theå loàng caùc caáu truùc ñieàu kieän vôùi nhau. Khi ñoù:
else if thaønh elif
Thí duï:
if test -f file1
then echo “file exists”
elif test -d file1
then echo “file is a directory”
fi
trong tröôøng hôïp naøy fi laø chung.
Chuù yù: cuù phaùp sau cuõng coù theå duøng ñöôïc:
if
then
else if
then
53
54. Copyright(c) by Galaxy CD – http://www.galaxycd.com
else
fi
c) Caùc toaùn töû | | vaø &&
Trong tröôøng hôïp ñieàu kieän ñôn giaûn, coù theå duøng toaùn töû hoaëc logic | |, hoaëc toaùn töû vaø
logic && ñeå laäp trình caáu truùc.
command1 && command2
Neáu command1 ñöôïc thöïc hieän toát, thì thöïc hieän command2, neáu khoâng thì ra.
command1 | | command2
Neáu command1 ñöôïc thöïc hieän toát, thì ra, neáu khoâng, thì thöïc hieän command2.
Chuù yù: coù theå duøng daáu ngoaëc ñôn ñeå goäp caùc leänh
Thí duï:
test -d demo && echo “demo is a directory”
test -d demo | | echo “demo is not a directory”
(test -d demo && ls -l demo) | | echo “demo not ok”
11.2.2 Reõ nhaùnh trong pheùp choïn moät trong nhieàu giaù trò:
Duøng caáu truùc:
case in esac
Caáu truùc treân cho pheùp choïn moät trong nhieàu xaâu kyù töï vaø thöïc hieän caùc leänh lieân quan
ñeán xaâu ñoù.
case $variable in
string1) cmd1
cmd2
……………
;;
string2) cmd1
cmd2
……………
;;
string3 | string4) commands
;;
esac
Chuù yù: coù theå duøng caùc metacharacter cuûa shell ñeå bieåu dieãn xaâu kyù töï,
| coù nghóa laø hoaëc
11.3 Laäp trình moät voøng laëp
11.3.1 Voøng laëp for
a) Caáu truùc: for in do done
Caáu truùc naøy cuûa for cho pheùp thöïc hieän moät chuoãi leänh nhö nhau vôùi moãi moät giaù trò
trong danh saùch ñaõ cho. Soá caùc voøng laëp baèng soá caùc giaù trò trong danh saùch.
for variable in val1 val2 val3 …
54
55. Copyright(c) by Galaxy CD – http://www.galaxycd.com
do command1
command2
command3
…………………
done
Vôùi variable coù theå gaùn ñöôïc caùc giaù trò val1, val2… thöïc hieän caùc leänh command1,
command2, …
Thí duï: WRITE laø moät shell_script gôûi thoâng baùo tôùi 3 ngöôøi duøng user1, user2, user3:
$cat WRITE
for i in user1 user2 user3
do write $I < message_file
done
b) Caáu truùc : for do done
Caáu truùc naøy cho pheùp thöïc hieän moät chuoãi leänh nhö nhau vôùi caùc ñoái ($1 $2 …) cuûa
shell_script ñöôïc goïi.
for variable
do command1
command2
command3
…………………
done
Vôùi variable coù theå gaùn ñöôïc caùc ñoái cuûa shell_scipt thöïc hieän caùc leänh command1,
command2, …
Thí duï:
Shell_script copy sao cheùp caùc file trong danh saùch ñoái vaøo danh muïc /users/user8 vaø
ñoåi nhoùm thaønh nhoùm student, ñoåi ngöôøi sôû höõu thaønh user8.
$cat copy
for i
do if [-f $i]
then cp $i /users/user8
chgrp student /users/user8/$i
chown user8 /users/user8/$i
fi
done
$ls -l
total 10
-rw------- 1 phil animator 56 May 31 14:14:22 file1
-rw------- 1 phil animator 22 May 31 15:14:22 file2
$copy file1 file2 toto
55
56. Copyright(c) by Galaxy CD – http://www.galaxycd.com
toto is not a file
$ls -l /users/user8
total 5
-rw------- 1 phil animator 56 May 31 14:14:22 file1
-rw------- 1 phil animator 22 May 31 15:14:22 file2
11.3.2 Voøng laëp while vaø until
a ) while do done
Voøng laëp while thöïc hieän moät chuoãi leänh khi ñieàu kieän vaãn coøn thoaû maõn.
while command1
do command2
command3
command4
…………………
done
Khi giaù trò traû veà cuûa vieäc thöïc hieän command1 vaãn thoaû maõn ñieàu kieän (true), shell
thöïc hieän tieáp chuoãi leänh giöõa do … done.
Hai leänh thöôøng duøng trong voøng laëp while:
true hoaëc : cho giaù trò true(0)
sleep[n] ñôïi n giaây
Thí duï:
- shell_script param hieån thò taát caû caùc ñoái cuûa leänh.
$cat param
while test $# -ne 0
do echo $1
shift
done
- shell_script disp_time hieån thò soá lieäu ngaøy thaùng theo khoaûng thôøi gian 30
giaây.
$cat disp_time
while true hoaëc while :
do date
sleep 30
done
b) until do done
Voøng laëp until hoaït ñoäng ngöôïc laïi vôùi voøng laëp while
until command1
do command2
command3
command4
…………………
56